Author: ltheussl
Date: Tue Jun 24 04:36:36 2008
New Revision: 671139

URL: http://svn.apache.org/viewvc?rev=671139&view=rev
Log:
[MPPDF-62] New property maven.pdf.generateTOC to specify the position of the 
Table of Contents.

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/viewvc/maven/maven-1/plugins/trunk/pdf/plugin.jelly?rev=671139&r1=671138&r2=671139&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/pdf/plugin.jelly Tue Jun 24 04:36:36 2008
@@ -102,6 +102,7 @@
 maven.pdf.projectLogo           = [${maven.pdf.projectLogo}]
 maven.pdf.companyLogo           = [${maven.pdf.companyLogo}]
 maven.pdf.createBookmarks       = [${maven.pdf.createBookmarks}]
+maven.pdf.generateTOC           = [${maven.pdf.generateTOC}]
 maven.jar.jimi                  = [${maven.jar.jimi}]
 maven.jar.jaicore               = [${maven.jar.jaicore}]
 maven.jar.jaicodec              = [${maven.jar.jaicodec}]
@@ -170,6 +171,12 @@
         <arg value="confidential"/>
         <arg value="${_confidential}"/>
       </j:if>
+      <j:set var="_generateTOC" value="${maven.pdf.generateTOC}"/>
+      <j:if test="${not empty(_generateTOC)}">
+        <arg value="-PARAM"/>
+        <arg value="generateTOC"/>
+        <arg value="${_generateTOC}"/>
+      </j:if>
       <j:set var="_paperType" value="${maven.pdf.paperType}"/>
       <j:if test="${not empty(_paperType)}">
       <arg value="-PARAM"/>

Modified: maven/maven-1/plugins/trunk/pdf/plugin.properties
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/pdf/plugin.properties?rev=671139&r1=671138&r2=671139&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/pdf/plugin.properties Tue Jun 24 04:36:36 2008
@@ -21,6 +21,8 @@
 # PDF plugin.
 # -------------------------------------------------------------------
 maven.pdf.confidential=false
+# generateTOC: may be 'start', 'end' or 'none'
+maven.pdf.generateTOC=start
 maven.pdf.paperType=A4
 maven.pdf.companyIncName=${pom.organization.name}
 #maven.pdf.copyrightYear=Not defined by default

Modified: maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/pdf/src/plugin-resources/project2fo.xslt?rev=671139&r1=671138&r2=671139&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 Tue 
Jun 24 04:36:36 2008
@@ -43,6 +43,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="generateTOC">start</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>
@@ -70,8 +71,13 @@
     </xsl:template>
     <xsl:template match="project/body">
         <xsl:call-template name="fo-cover"/>
-        <xsl:call-template name="fo-toc"/>
+        <xsl:if test="$generateTOC = 'start'">
+            <xsl:call-template name="fo-toc"/>
+        </xsl:if>
         <xsl:apply-templates/>
+        <xsl:if test="$generateTOC = 'end'">
+            <xsl:call-template name="fo-toc"/>
+        </xsl:if>
     </xsl:template>
     <xsl:template match="project/body/menu">
         <xsl:apply-templates/>

Modified: maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml?rev=671139&r1=671138&r2=671139&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/pdf/xdocs/changes.xml Tue Jun 24 04:36:36 2008
@@ -26,8 +26,11 @@
   </properties>  
   <body> 
     <release version="2.5.2-SNAPSHOT" date="in SVN"> 
+      <action dev="ltheussl" type="add" issue="MPPDF-62">New property
+        <code>maven.pdf.generateTOC</code>to specify the position of the Table 
of Contents. This can be used to work around some memory problems with large 
files.
+      </action>  
       <action dev="ltheussl" type="fix" issue="MPPDF-56">Add support for 
<code><![CDATA[<font>]]></code> and <code><![CDATA[<samp>]]></code> 
tags.</action> 
-      <action dev="ltheussl" type="fix" issue="MPPDF-61">PDF generates content 
for <code><![CDATA[<script>]]>.</action> 
+      <action dev="ltheussl" type="fix" issue="MPPDF-61">PDF generates content 
for <code><![CDATA[<script>]]></code> .</action> 
     </release>  
     <release version="2.5.1" date="2007-03-28"> 
       <action dev="ltheussl" type="fix" issue="MPPDF-57">Unable to remove 
cover type and version.</action> 

Modified: maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml?rev=671139&r1=671138&r2=671139&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/pdf/xdocs/properties.xml Tue Jun 24 04:36:36 
2008
@@ -89,6 +89,16 @@
             <td><code>false</code></td>
           </tr>
           <tr>
+            <td width="25%">maven.pdf.generateTOC</td>
+            <td>
+              If/Where to generate the Table of Contents. Possible values are 
'<code>start</code>' (default), '<code>end</code>' and '<code>none</code>'.
+              Use this in particular if you experience memory problems with 
large documents: moving the Table of Contents to the end of the file,
+              or excluding it, greatly reduces memory consumption.
+            </td>
+            <td width="10%">Yes</td>
+            <td><code>start</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 


Reply via email to