You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2005/12/04 09:06:21 UTC

svn commit: r353832 - in /maven/maven-1/plugins/trunk/pdf: plugin.jelly plugin.properties src/plugin-resources/fo-outline.xslt src/plugin-resources/project2fo.xslt xdocs/changes.xml xdocs/properties.xml

Author: ltheussl
Date: Sun Dec  4 00:06:18 2005
New Revision: 353832

URL: http://svn.apache.org/viewcvs?rev=353832&view=rev
Log:
Add PDF bookmarks. Thanks to Greg Ludington.

Added:
    maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt   (with props)
Modified:
    maven/maven-1/plugins/trunk/pdf/plugin.jelly
    maven/maven-1/plugins/trunk/pdf/plugin.properties
    maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt
    maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml
    maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml

Modified: maven/maven-1/plugins/trunk/pdf/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/plugin.jelly?rev=353832&r1=353831&r2=353832&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/pdf/plugin.jelly Sun Dec  4 00:06:18 2005
@@ -99,6 +99,7 @@
 maven.pdf.cover.date            = [${maven.pdf.cover.date}]
 maven.pdf.projectLogo           = [${maven.pdf.projectLogo}]
 maven.pdf.companyLogo           = [${maven.pdf.companyLogo}]
+maven.pdf.createBookmarks       = [${maven.pdf.createBookmarks}]
 maven.jar.jimi                  = [${maven.jar.jimi}]
 maven.jar.jaicore               = [${maven.jar.jaicore}]
 maven.jar.jaicodec              = [${maven.jar.jaicodec}]
@@ -211,6 +212,9 @@
       <arg value="-PARAM"/>
       <arg value="debug"/>
       <arg value="${maven.pdf.debug}"/>
+      <arg value="-PARAM"/>
+      <arg value="createBookmarks"/>
+      <arg value="${maven.pdf.createBookmarks}"/>
       <arg value="-PARAM"/>
       <arg value="header_Height"/>
       <arg value="${maven.pdf.cover.headerHeight}"/>

Modified: maven/maven-1/plugins/trunk/pdf/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/plugin.properties?rev=353832&r1=353831&r2=353832&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/pdf/plugin.properties Sun Dec  4 00:06:18 2005
@@ -25,6 +25,7 @@
 #maven.pdf.copyrightYear=Not defined by default
 maven.pdf.imageDpi=75
 maven.pdf.debug=false
+maven.pdf.createBookmarks=false
 maven.pdf.navigationFile=navigation.xml
 maven.pdf.navigationFilePath=${maven.xdoc.src}
 maven.pdf.pdfName=${pom.artifactId}.pdf

Added: maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt?rev=353832&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt (added)
+++ maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt Sun Dec  4 00:06:18 2005
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0" xmlns:fox="http://xml.apache.org/fop/extensions">
+    <!-- Templates for handling the outline -->
+    <xsl:template name="fo-outline">
+        <xsl:apply-templates mode="outline"/>
+    </xsl:template>
+
+    <xsl:template match="project/body" mode="outline">
+        <xsl:apply-templates mode="outline"/>
+    </xsl:template>
+
+    <xsl:template match="menu | menu/item | menu/item/item | menu/item/item/item" mode="outline">
+        <!-- use the apache FOP outline extension to recursively create bookmark block -->
+        <fox:outline internal-destination="{@href}{generate-id()}">
+            <fox:label><xsl:value-of select="@name"/></fox:label>
+            <xsl:apply-templates mode="outline"/>
+        </fox:outline>
+    </xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file

Propchange: maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/maven-1/plugins/trunk/pdf/src/plugin-resources/fo-outline.xslt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt?rev=353832&r1=353831&r2=353832&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt (original)
+++ maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt Sun Dec  4 00:06:18 2005
@@ -20,6 +20,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/TR/2001/REC-SVG-20010904" version="1.0">
     <xsl:include href="fo-styles.xslt"/>
     <xsl:include href="fo-layouts.xslt"/>
+    <xsl:include href="fo-outline.xslt"/>
     <xsl:include href="fo-cover.xslt"/>
     <xsl:include href="fo-toc.xslt"/>
     <xsl:include href="fo-body.xslt"/>
@@ -41,6 +42,7 @@
     <xsl:param name="header_Height">0.5</xsl:param>
     <xsl:param name="footer_Height">0.3</xsl:param>
     <xsl:param name="debug">false</xsl:param>
+    <xsl:param name="createBookmarks"/>
     <!-- These next two variables are used in cheap-and-cheerful case conversions -->
     <xsl:variable name="lc">abcdefghijklmnopqrstuvwxyz</xsl:variable>
     <xsl:variable name="uc">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
@@ -58,6 +60,9 @@
     </xsl:template>
     <xsl:template match="project">
         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+            <xsl:if test="$createBookmarks = 'true'">
+                <xsl:call-template name="fo-outline"/>
+            </xsl:if>
             <xsl:call-template name="fo-layouts"/>
             <xsl:apply-templates/>
         </fo:root>

Modified: maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml?rev=353832&r1=353831&r2=353832&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml Sun Dec  4 00:06:18 2005
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="2.5-SNAPSHOT" date="in SVN">
+      <action dev="ltheussl" type="add" due-to="Greg Ludington">New property <code>maven.pdf.createBookmarks</code> to create PDF bookmarks.</action>
       <action dev="ltheussl" type="fix" issue="MPPDF-53">Title and dates are incorrect when used with Maven 1.0.2.</action>
       <action dev="ltheussl" type="fix" issue="MPPDF-54">Identical ids in tables in different documents caused a build failure.</action>
       <action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : 

Modified: maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml?rev=353832&r1=353831&r2=353832&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml Sun Dec  4 00:06:18 2005
@@ -82,6 +82,12 @@
             </td>
           </tr>
           <tr>
+            <td width="25%">maven.pdf.createBookmarks</td>
+            <td>Add PDF bookmarks.</td>
+            <td width="10%">Yes</td>
+            <td><code>false</code></td>
+          </tr>
+          <tr>
             <td width="25%">maven.pdf.navigationFile</td>
             <td>Filename for the navigation file used to generate the 
                     PDF. It allows to separate the content of the site