evenisse    2004/01/15 05:56:34

  Modified:    pdf      plugin.jelly plugin.properties project.properties
                        project.xml
               pdf/src/plugin-resources project2fo.xslt
               pdf/xdocs changes.xml
  Log:
  MAVEN-MPPDF-1. Completely re-writte of the PDF plug-in. It solves most of the 
thorniest issues, such as table formatting, more levels in the table of contents, and 
image sizing. The graphic design is also dramatically improved.
  
  Revision  Changes    Path
  1.7       +99 -41    maven-plugins/pdf/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/plugin.jelly,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- plugin.jelly      29 Aug 2003 06:27:52 -0000      1.6
  +++ plugin.jelly      15 Jan 2004 13:56:34 -0000      1.7
  @@ -1,14 +1,47 @@
  -<?xml version="1.0"?>
  +<?xml version="1.0" encoding="UTF-8"?>
   
  -<project xmlns:j="jelly:core" xmlns:u="jelly:util">
  +<project xmlns:j="jelly:core">
   
  -  <goal 
  +  <goal
       name="pdf:init"
       prereqs="xdoc:init">
  -
  -    <j:set var="docsDest" value="${maven.docs.dest}"/>
  -    <j:set var="docsSrc" value="${maven.docs.src}"/>
  -
  +    <j:set var="docsXdocSrc"
  +      
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}"/>
  +    <j:set var="docsGenSrc"
  +      
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
  +    <j:set var="docsPdf"
  +      value="${maven.build.dir}/pdf"/>
  +    <j:set var="docsToc"
  +      
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}/navigation.xml"/>
  +    <j:set var="confidential"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.confidential')}"/>
  +    <j:set var="paperType"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.paperType')}"/>
  +    <j:set var="companyName"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyName')}"/>
  +    <j:set var="companyIncName"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyIncName')}"/>
  +    <j:set var="publicationYear"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.copyrightYear')}"/>
  +    <j:set var="coverProjectCompany"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectCompany')}"/>
  +    <j:set var="coverProjectName"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectName')}"/>
  +    <j:set var="coverType"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.type')}"/>
  +    <j:set var="coverVersion"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.version')}"/>
  +    <j:set var="coverDate"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.date')}"/>
  +    <j:set var="projectLogo"
  +      
value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/>
  +    <j:set var="companyLogo"
  +      
value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyLogo')}"/>
  +    <j:set var="imageDpi"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.imageDpi')}"/>
  +    <j:set var="debug"
  +      
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.debug')}"/>
  +    <mkdir dir="${docsPdf}"/>
     </goal>
   
     <goal
  @@ -16,62 +49,87 @@
       prereqs="fo:fo"
       description="Generate XSL:FO project documentation"/>
   
  -  <goal name="fo:fo" 
  -    prereqs="pdf:init"
  +  <goal name="fo:fo"
  +    prereqs="pdf:prepare"
       description="Generate XSL:FO project documentation">
  -    
       <echo>Generating ${docsDest}/project.fo ...</echo>
  -    <available file="${docsSrc}/navigation.xml" 
  +    <available file="${docsToc}"
         property="maven.fo.navigation.available"/>
  -    <fail message="PDF generation cannot complete as ${docsSrc}/navigation.xml is 
missing"
  +    <fail message="PDF generation cannot complete as ${docsToc} is missing"
         unless="maven.fo.navigation.available"/>
  -    <u:file name="${plugin.resources}/project2fo.xslt" var="stylesheetFile" />
  -    <u:file name="${docsSrc}/navigation.xml" var="navigationFile" />
  -    <java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
  -      <classpath>
  -        <pathelement location="${plugin.getDependencyPath('xerces')}"/>
  -        <pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
  -        <pathelement location="${plugin.getDependencyPath('xalan')}"/>
  -      </classpath>
  -      <sysproperty key="user.language" value="en"/>
  -      <arg value="-in"/>
  -      <arg value="${navigationFile.toURL().toExternalForm()}"/>
  -      <arg value="-out"/>
  -      <arg value="${docsDest}/project.fo"/>
  -      <arg value="-xsl"/>
  -      <arg value="${stylesheetFile.toURL().toExternalForm()}"/>
  -      <arg value="-param"/>
  -      <arg value="basePath"/>
  -      <arg value="${docsSrc}"/>
  -    </java>
  -
  +    <!-- 'Major hack.' Stolen from the Latka plugin.jelly. All of this could be 
avoided by putting
  +         xalan into $MAVEN_HOME/lib/endorsed directory in the distribution, but 
never mind -->
  +    
${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
  +    <style in="${docsToc}" out="${docsPdf}/project.fo" 
style="${plugin.resources}/project2fo.xslt" force="true">
  +      <param name="basePath"  expression="${docsPdf}"/>
  +      <param name="confidential" expression="${confidential}"/>
  +      <param name="paperType" expression="${paperType}"/>
  +      <param name="companyName" expression="${companyName}"/>
  +      <param name="companyIncName" expression="${companyIncName}"/>
  +      <param name="publicationYear" expression="${publicationYear}"/>
  +      <param name="coverProjectCompany" expression="${coverProjectCompany}"/>
  +      <param name="coverProjectName" expression="${coverProjectName}"/>
  +      <param name="coverType" expression="${coverType}"/>
  +      <param name="coverVersion" expression="${coverVersion}"/>
  +      <param name="coverDate" expression="${coverDate}"/>
  +      <param name="companyLogo" expression="${companyLogo}"/>
  +      <param name="projectLogo" expression="${projectLogo}"/>
  +      <param name="imageDpi" expression="${imageDpi}"/>
  +      <param name="debug" expression="${debug}"/>
  +    </style>
     </goal>
   
     <goal
       name="pdf"
  -    prereqs="pdf:pdf"
  +    prereqs="fo:fo,pdf:prepare,pdf:pdf"
       description="Generate PDF project documentation"/>
   
  -  <goal name="pdf:pdf" description="Generate PDF project documentation"
  -     prereqs="pdf:init, fo">
  +  <goal
  +    name="pdf:prepare"
  +    prereqs="pdf:init"
  +    description="Stages all files needed to generate the PDF">
  +    <!-- First, copy all of the generated xdocs -->
  +    <copy todir="${docsPdf}">
  +      <fileset dir="${docsGenSrc}" force="true">
  +        <include name="**/*.*"/>
  +      </fileset>
  +    </copy>
  +    <!-- Then, copy all of the user-supplied xdocs -->
  +    <copy todir="${docsPdf}" force="true">
  +      <fileset dir="${docsXdocSrc}">
  +        <include name="**/*.*"/>
  +      </fileset>
  +    </copy>    
  +    <!-- Finally, copy the FOP config file and all of the fonts -->
  +    <copy todir="${docsPdf}" force="true">
  +      <fileset dir="${plugin.resources}">
  +        <include name="userconfig.xml"/>
  +        <include name="fonts/*.*"/>
  +      </fileset>
  +    </copy>
  +  </goal>
   
  -    <echo>Generating ${docsDest}/project.pdf ...</echo>
  -    <java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true">
  +  <goal name="pdf:pdf" description="Generate PDF project documentation"
  +     prereqs="pdf:prepare">
  +    <echo>Generating ${docsPdf}/project.pdf ...</echo>
  +    <echo>Config file: ${docsPdf}/userconfig.xml</echo>
  +    <java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true" 
maxmemory="500m">
         <classpath>
           <pathelement location="${plugin.getDependencyPath('fop')}"/>
           <pathelement location="${plugin.getDependencyPath('batik')}"/>
           <pathelement location="${plugin.getDependencyPath('logkit')}"/>
           <pathelement location="${plugin.getDependencyPath('avalon-framework')}"/>
           <pathelement location="${plugin.getDependencyPath('xerces')}"/>
  -        <pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
         </classpath>
  +      <arg value="-c" />
  +      <arg value="${docsPdf}/userconfig.xml" />
         <arg value="-d" />
         <arg value="-fo" />
  -      <arg value="${docsDest}/project.fo" />
  +      <arg value="${docsPdf}/project.fo" />
         <arg value="-pdf" />
  -      <arg value="${docsDest}/project.pdf"/>
  +      <arg value="${docsPdf}/project.pdf"/>
  +      <sysproperty key="javax.xml.transform.TransformerFactory" 
value="org.apache.xalan.processor.TransformerFactoryImpl"/>
       </java>
  -
     </goal>
   
   </project>
  
  
  
  1.3       +15 -1     maven-plugins/pdf/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/plugin.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.properties 25 Jan 2003 18:19:54 -0000      1.2
  +++ plugin.properties 15 Jan 2004 13:56:34 -0000      1.3
  @@ -3,4 +3,18 @@
   # -------------------------------------------------------------------
   # PDF plugin.
   # -------------------------------------------------------------------
  -
  +maven.pdf.confidential=false
  +maven.pdf.paperType=US
  +maven.pdf.companyName=Apache Software Foundation
  +maven.pdf.companyIncName=Apache Software Foundation, Inc.
  +maven.pdf.copyrightYear=2003
  +maven.pdf.imageDpi=150
  +maven.pdf.debug=false
  +# Reserved for future use...
  +maven.pdf.cover.projectCompany=Apache Software Foundation
  +maven.pdf.cover.projectName=Microsoft Windows Server 2003 with .NET Framework and 
IBM WebSphere
  +maven.pdf.cover.type=Research Report
  +maven.pdf.cover.version=1.0
  +maven.pdf.cover.date=June 2, 2003
  +maven.pdf.projectLogo=project_logo.gif
  +maven.pdf.companyLogo=company_logo.gif
  
  
  
  1.5       +2 -2      maven-plugins/pdf/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/project.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.properties        6 Jan 2004 19:07:38 -0000       1.4
  +++ project.properties        15 Jan 2004 13:56:34 -0000      1.5
  @@ -2,6 +2,6 @@
   # P R O J E C T  P R O P E R T I E S
   # -------------------------------------------------------------------
   maven.xdoc.date=left
  -## maven.xdoc.version=${pom.currentVersion}
  -maven.license.licenseFile=${basedir}/../LICENSE.txt
  +maven.xdoc.version=${pom.currentVersion}
  +maven.license.licenseFile=${basedir}/../../../LICENSE.txt
   
  
  
  
  1.21      +26 -21    maven-plugins/pdf/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/project.xml,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- project.xml       29 Dec 2003 04:38:06 -0000      1.20
  +++ project.xml       15 Jan 2004 13:56:34 -0000      1.21
  @@ -1,15 +1,17 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
   <project>
  -  <extend>../project.xml</extend>
  +  <extend>${basedir}/../project.xml</extend>
     <pomVersion>3</pomVersion>
  -  <id>maven-pdf-plugin</id>
  +  <groupId>maven</groupId>
  +  <artifactId>maven-pdf-plugin</artifactId>
     <name>Maven PDF Plug-in</name>
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>2.0-SNAPSHOT</currentVersion>
     <description/>
  -  <shortDescription>Create PDF version of site docs</shortDescription>
  +  <shortDescription>Java Project Management Tools</shortDescription>
     <url>http://maven.apache.org/reference/plugins/pdf/</url>
     <siteDirectory>/www/maven.apache.org/reference/plugins/pdf/</siteDirectory>
  +  
<issueTrackingUrl>http://jira.codehaus.org/secure/BrowseProject.jspa?id=10356</issueTrackingUrl>
     <repository>
       <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-plugins/pdf/</connection>
       <url>http://cvs.apache.org/viewcvs/maven-plugins/pdf/</url>
  @@ -34,47 +36,50 @@
           <role>Release Manager</role>
         </roles>
       </developer>
  +    <developer>
  +      <name>Andrew Jaquith</name>
  +      <id>arjaquith</id>
  +      <email>[EMAIL PROTECTED]</email>
  +      <organization>freshcookies.org</organization>
  +      <roles>
  +        <role>Architect</role>
  +        <role>Documentation</role>
  +      </roles>
  +    </developer>
     </developers>
     <dependencies>
       <dependency>
  -      <groupId>fop</groupId>
  -      <artifactId>fop</artifactId>
  -      <version>0.20.5rc2</version>
  +      <id>fop</id>
  +      <version>0.20.5</version>
       </dependency>
       <dependency>
  -      <groupId>batik</groupId>
  -      <artifactId>batik</artifactId>
  -      <version>1.1.1</version>
  +      <id>batik</id>
  +      <version>1.5-fop-0.20-5</version>
       </dependency>
       <dependency>
  -      <groupId>logkit</groupId>
  -      <artifactId>logkit</artifactId>
  +      <id>logkit</id>
         <version>1.0.1</version>
       </dependency>
       <dependency>
  -      <groupId>avalon-framework</groupId>
  -      <artifactId>avalon-framework</artifactId>
  +      <id>avalon-framework</id>
         <version>4.0</version>
       </dependency>
       <dependency>
  -      <groupId>xerces</groupId>
  -      <artifactId>xerces</artifactId>
  -      <version>2.4.0</version>
  +      <id>xerces</id>
  +      <version>2.3.0</version>
         <properties>
           <classloader>root</classloader>
         </properties>
       </dependency>
       <dependency>
  -      <groupId>xml-apis</groupId>
  -      <artifactId>xml-apis</artifactId>
  +      <id>xml-apis</id>
         <version>1.0.b2</version>
         <properties>
           <classloader>root</classloader>
         </properties>
       </dependency>
       <dependency>
  -      <groupId>xalan</groupId>
  -      <artifactId>xalan</artifactId>
  +      <id>xalan</id>
         <version>2.4.1</version>
       </dependency>
     </dependencies>
  
  
  
  1.4       +161 -439  maven-plugins/pdf/src/plugin-resources/project2fo.xslt
  
  Index: project2fo.xslt
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/src/plugin-resources/project2fo.xslt,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project2fo.xslt   12 Mar 2003 15:38:01 -0000      1.3
  +++ project2fo.xslt   15 Jan 2004 13:56:34 -0000      1.4
  @@ -1,447 +1,169 @@
  -<?xml version='1.0'?>
  +<?xml version="1.0" encoding="UTF-8"?>
  +<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-layouts.xslt" />
  +  <!--<xsl:include href="fo-cover.xslt" />-->
  +  <xsl:include href="fo-toc.xslt" />
  +  <xsl:include href="fo-body.xslt" />
  +  <xsl:include href="fo-tables.xslt" />
  +  <xsl:include href="fo-table-column-widths.xslt" />
  +  <xsl:param name="basePath">.</xsl:param>
  +  <xsl:param name="paperType">US</xsl:param>
  +  <xsl:param name="companyName">The Jakarta Project</xsl:param>
  +  <xsl:param name="companyIncName">Apache Software Foundation, Inc.</xsl:param>
  +  <xsl:param name="confidential">false</xsl:param>
  +  <xsl:param name="publicationYear">2003</xsl:param>
  +  <xsl:param name="imageDpi">150</xsl:param>
  +  <xsl:param name="companyLogo"/>
  +  <xsl:param name="projectLogo"/>
  +  <xsl:param name="coverProjectCompany">Apache Software Foundation</xsl:param>
  +  <xsl:param name="coverProjectName">Jakarta Maven</xsl:param>
  +  <xsl:param name="coverType">Project Documentation</xsl:param>
  +  <xsl:param name="coverVersion">1.0</xsl:param>
  +  <xsl:param name="coverDate">January 1, 1901</xsl:param>
  +  <xsl:param name="debug"></xsl:param>
  +  <!-- 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>
  +  <xsl:variable name="footerText">&#169;<xsl:value-of select="$publicationYear"/>
  +    <xsl:value-of select="concat(' ',$companyIncName)"/> &#8226; All rights reserved
  +    <xsl:if test="$confidential = 'true'">
  +      &#8226; Proprietary and Confidential
  +    </xsl:if>
  +  </xsl:variable>
  +  <xsl:variable name="colorDarkGray">#454545</xsl:variable>
  +  <xsl:variable name="colorMediumGray">#A9A9A9</xsl:variable>
  +  <xsl:variable name="colorLightGray">#D3D3D3</xsl:variable>
  +  <!--
  +  <xsl:variable name="colorWarmGrey11">#504b42</xsl:variable>
  + -->
  +  <xsl:variable name="colorWarmGrey11">#4b4542</xsl:variable>
  +
  +  <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
  +
  +  <!--
  +  <xsl:param name="debug">true</xsl:param>
  +  -->
  +
  +  <!-- Error style -->
  +  <xsl:attribute-set name="error.block" use-attribute-sets="base.block">
  +    <xsl:attribute name="font-size">8pt</xsl:attribute>
  +    <xsl:attribute name="font-weight">bold</xsl:attribute>
  +    <xsl:attribute name="color">red</xsl:attribute>
  +    <xsl:attribute name="border-style">solid</xsl:attribute>
  +    <xsl:attribute name="border-width">0.5pt</xsl:attribute>
  +    <xsl:attribute name="border-color">red</xsl:attribute>
  +    <xsl:attribute name="padding">0.75em</xsl:attribute>
  +    <xsl:attribute name="start-indent">inherited-property-value(start-indent) + 
2.5em</xsl:attribute>
  +    <xsl:attribute name="end-indent">inherited-property-value(end-indent) + 
3em</xsl:attribute>
  +  </xsl:attribute-set>
  +
  +
  +  <!-- Templates -->
  +
  +  <xsl:template match="/">
  +    <xsl:apply-templates select="project" />
  +  </xsl:template>
   
  -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  -                xmlns:fo="http://www.w3.org/1999/XSL/Format";
  -                version='1.0'>
  -
  -<xsl:param name="basePath">.</xsl:param>
  -
  -<xsl:attribute-set name="base.body.style">
  -    <xsl:attribute name="font-family">serif</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="base.header.style">
  -    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
  -    <xsl:attribute name="color">#000036</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="chapter.header.top"
  -                   use-attribute-sets="base.header.style">
  -    <xsl:attribute name="font-size">14pt</xsl:attribute>
  -    <xsl:attribute name="text-align">right</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="chapter.header.bottom"
  -                   use-attribute-sets="base.header.style">
  -    <xsl:attribute name="space-before.optimum">0.5em</xsl:attribute>
  -    <xsl:attribute name="font-size">16pt</xsl:attribute>
  -    <xsl:attribute name="text-align">right</xsl:attribute>
  -    <xsl:attribute name="space-after.optimum">5em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="normal.header"
  -                   use-attribute-sets="base.header.style">
  -    <xsl:attribute name="space-before.optimum">1.5em</xsl:attribute>
  -    <xsl:attribute name="space-before.minimum">1.2em</xsl:attribute>
  -    <xsl:attribute name="space-before.maximum">2.0em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="normal.paragraph"
  -                   use-attribute-sets="base.body.style">
  -    <xsl:attribute name="space-before.optimum">1.0em</xsl:attribute>
  -    <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
  -    <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="normal.pre"
  -                   use-attribute-sets="normal.paragraph">
  -    <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
  -    <xsl:attribute name="white-space-collapse">false</xsl:attribute>
  -    <xsl:attribute name="font-family">monospace</xsl:attribute>
  -    <xsl:attribute name="color">gray</xsl:attribute>
  -    <xsl:attribute name="border">dotted thin gray</xsl:attribute>
  -    <xsl:attribute name="padding">0.5em</xsl:attribute>
  -    <xsl:attribute name="start-indent">0.5em</xsl:attribute>
  -    <xsl:attribute name="end-indent">0.5em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:template match="project">
  +  <xsl:template match="project">
       <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  -    <!-- defines the layout master -->
  -    <fo:layout-master-set>
  -      <fo:simple-page-master
  -         master-name="main"
  -        margin-top="1in"
  -        margin-bottom="1in"
  -        margin-left="1in"
  -        margin-right="1in">
  -          <fo:region-body margin-bottom="0.5in"/>
  -          <fo:region-after extent="0.25in"/>
  -      </fo:simple-page-master>
  -    </fo:layout-master-set>
  -
  -    <xsl:apply-templates/>
  -
  +      <xsl:call-template name="fo-layouts" />
  +      <xsl:apply-templates />
       </fo:root>
  -</xsl:template>
  -
  -<xsl:template match="project/body">
  -
  -    <!-- Table of contents -->
  -
  -    <fo:page-sequence master-reference="main">
  -
  -        <!-- header -->
  -        <fo:static-content flow-name="xsl-region-after">
  -            <fo:block font-size="8pt"
  -                       font-family="serif"
  -                      text-align="right">
  -                Table of Contents
  -                &#8211;
  -                <fo:page-number/>
  -            </fo:block>
  -        </fo:static-content>
  -
  -        <fo:flow flow-name="xsl-region-body">
  -
  -            <fo:block id="[EMAIL PROTECTED]" 
xsl:use-attribute-sets="chapter.header.top">
  -                <xsl:value-of select="../title"/>
  -            </fo:block>
  -            <fo:block>
  -                <fo:leader leader-pattern="rule"/>
  -            </fo:block>
  -            <fo:block xsl:use-attribute-sets="chapter.header.bottom">
  -                Table of Contents
  -            </fo:block>
  -
  -            <fo:table>
  -
  -                <fo:table-column column-width="1cm"/>
  -                <fo:table-column column-width="13cm"/>
  -                <fo:table-column column-width="1cm"/>
  -
  -                <fo:table-body>
  -
  -                    <xsl:apply-templates mode="toc"/>
  -
  -                </fo:table-body>
  -
  -            </fo:table>
  -
  -        </fo:flow>
  -
  -    </fo:page-sequence>
  -
  -    <!-- The sections -->
  -
  -    <xsl:apply-templates/>
  -
  -</xsl:template>
  -
  -<xsl:template match="project/body/menu" mode="toc">
  -
  -    <fo:table-row>
  -        <fo:table-cell>
  -            <fo:block><xsl:number count="menu"/></fo:block>
  -        </fo:table-cell>
  -        <fo:table-cell>
  -            <fo:block font-weight="bold">
  -                 <xsl:value-of select="@name"/>
  -            </fo:block>
  -        </fo:table-cell>
  -        <fo:table-cell/>
  -    </fo:table-row>
  -
  -    <xsl:apply-templates mode="toc"/>
  -
  -</xsl:template>
  -
  -<xsl:template match="project/body/menu/item" mode="toc">
  -
  -    <fo:table-row>
  -
  -        <fo:table-cell>
  -            <fo:block>
  -                <xsl:number count="menu"/>.<xsl:number count="item"/>
  -            </fo:block>
  -        </fo:table-cell>
  -
  -        <fo:table-cell>
  -            <fo:block>
  -                <fo:basic-link internal-destination="[EMAIL PROTECTED]">
  -                    <xsl:value-of select="@name"/>
  -                    <fo:leader leader-pattern="dots" 
keep-with-next.within-line="always"/>
  -                </fo:basic-link>
  -            </fo:block>
  -        </fo:table-cell>
  -
  -        <fo:table-cell>
  -            <fo:block text-align="right">
  -                <fo:basic-link internal-destination="[EMAIL PROTECTED]">
  -                    <fo:page-number-citation ref-id="[EMAIL PROTECTED]"/>
  -                </fo:basic-link>
  -            </fo:block>
  -        </fo:table-cell>
  -
  -    </fo:table-row>
  -
  -</xsl:template>
  -
  -<xsl:template match="project/body/menu">
  -    <xsl:apply-templates/>
  -</xsl:template>
  -
  -<xsl:template match="project/body/menu/item">
  -    <!-- this effectively renders the xml document from the href html doc -->
  -    <xsl:variable name="document"
  -        select="document( concat( $basePath, '/', substring-before( @href, '.html' 
), '.xml' ) )/document"/>
  -
  -    <fo:page-sequence master-reference="main">
  -
  -        <!-- header -->
  -        <fo:static-content flow-name="xsl-region-after">
  -            <fo:block font-size="8pt"
  -                       font-family="serif"
  -                      text-align="right">
  -                <xsl:value-of select="$document/properties/title"/>
  -                &#8211;
  -                <fo:page-number/>
  -            </fo:block>
  -        </fo:static-content>
  +  </xsl:template>
   
  +  <xsl:template match="project/body">
  +    <!-- Custom cover pages will be included in a future version -->
  +<!--    
  +     <xsl:call-template name="fo-cover" />
  +     <xsl:call-template name="fo-cover-inside" />
  +  -->     
  +     <xsl:call-template name="fo-toc" />
  +     <xsl:apply-templates />
  +   </xsl:template>
  +
  +  <xsl:template match="project/body/menu">
  +    <xsl:apply-templates />
  +  </xsl:template>
  +
  +  <xsl:template match="project/body/menu/item">
  +    <!-- Renders the xml xdoc document -->
  +    <xsl:call-template name="render-xdoc">
  +      <xsl:with-param name="chapterNumber"><xsl:number count="menu" />.<xsl:number 
count="menu/item" /></xsl:with-param>
  +    </xsl:call-template>
  +    <xsl:apply-templates />
  +  </xsl:template>
  +
  +  <xsl:template match="project/body/menu/item/item">
  +    <!-- Renders the xml xdoc document -->
  +    <xsl:call-template name="render-xdoc">
  +      <xsl:with-param name="chapterNumber"><xsl:number count="menu" />.<xsl:number 
count="menu/item" />.<xsl:number count="menu/item/item" /></xsl:with-param>
  +    </xsl:call-template>
  +    <xsl:apply-templates />
  +  </xsl:template>
  +
  +  <xsl:template match="project/body/menu/item/item/item">
  +    <!-- Renders the xml xdoc document -->
  +    <xsl:call-template name="render-xdoc">
  +      <xsl:with-param name="chapterNumber"><xsl:number count="menu"/>.<xsl:number 
count="menu/item"/>.<xsl:number count="menu/item/item"/>.<xsl:number 
count="menu/item/item/item"/></xsl:with-param>
  +    </xsl:call-template>
  +  </xsl:template>
  +
  +  <xsl:template name="render-xdoc">
  +    <xsl:param name="chapterNumber">Foo</xsl:param>
  +    <!-- Set the page number to start at. Normally this is 'auto'
  +         unless we are at the very first xdoc, in which case we reset it to 1 -->
  +    <xsl:variable name="pageStart">
  +      <xsl:choose>
  +        <xsl:when test="normalize-space(translate($chapterNumber,'1.','  '))">
  +          <xsl:text>auto</xsl:text>
  +        </xsl:when>
  +        <xsl:otherwise>
  +          <xsl:text>1</xsl:text>
  +        </xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:variable>
  +    <!-- Renders the xml xdoc document -->
  +    <!-- Retrieve the xdoc file relative to the basePath;
  +         the name is the href, but substitute .xml as the suffix -->
  +    <xsl:variable name="href" select="@href"/>
  +    <xsl:variable name="documentName" select="substring-before( @href, '.html' )"/>
  +    <xsl:variable name="documentPath" select="concat($basePath, $documentName, 
'.xml')"/>
  +    <xsl:if test="normalize-space(@href)">
  +      <xsl:if test="$debug = 'true'">
  +        <xsl:message>
  +Href  = <xsl:value-of select="$href"/></xsl:message>
  +        <xsl:message>
  +Doc Name = <xsl:value-of select="$documentName"/></xsl:message>
  +        <xsl:message>
  +Doc Path = <xsl:value-of select="$documentPath"/></xsl:message>
  +        <xsl:message>Creating XSL:FO for <xsl:value-of 
select="$documentPath"/></xsl:message>
  +      </xsl:if>
  +      <fo:page-sequence master-reference="body" initial-page-number="{$pageStart}">
  +        <!-- Render the header and footer -->
  +          <xsl:call-template name="body-header">
  +          <xsl:with-param name="headerText" select="concat($chapterNumber, '   ', 
translate(@name, $lc, $uc))"/>
  +        </xsl:call-template>
  +        <xsl:call-template name="body-footer">
  +          <xsl:with-param name="footerText" select="translate($footerText, $lc, 
$uc)"/>
  +        </xsl:call-template>
           <fo:flow flow-name="xsl-region-body">
  -
  -            <fo:block id="[EMAIL PROTECTED]" 
xsl:use-attribute-sets="chapter.header.top">
  -                <xsl:number count="menu"/>.<xsl:number count="item"/>
  -            </fo:block>
  -            <fo:block>
  -                <fo:leader leader-pattern="rule"/>
  -            </fo:block>
  -            <fo:block xsl:use-attribute-sets="chapter.header.bottom">
  -                <xsl:value-of select="$document/properties/title"/>
  -            </fo:block>
  -
  -            <xsl:apply-templates select="$document/body"/>
  -
  +          <!-- Render the chapter heading -->
  +          <xsl:call-template name="body-chapter-heading">
  +            <xsl:with-param name="chapterNumber"><xsl:value-of 
select="$chapterNumber"/></xsl:with-param>
  +            <xsl:with-param name="chapter"><xsl:value-of select="@name" 
/></xsl:with-param>
  +          </xsl:call-template>
  +          <!-- Render the associated xdoc -->
  +          <fo:block id="[EMAIL PROTECTED]()}">
  +            <xsl:apply-templates select="document($documentPath)/document/body" />
  +          </fo:block>
           </fo:flow>
  -
  -    </fo:page-sequence>
  -
  -</xsl:template>
  -
  -<!-- ================= the following templates are for xdocs (not projects) -->
  -
  -<xsl:template match="document/body">
  -
  -    <xsl:apply-templates/>
  -
  -</xsl:template>
  -
  -<xsl:template match="section">
  -
  -  <fo:block font-size="14pt" xsl:use-attribute-sets="normal.header">
  -        <xsl:value-of select="@name"/>
  -  </fo:block>
  -
  -  <xsl:apply-templates/>
  -
  -</xsl:template>
  -
  -<xsl:template match="subsection">
  -
  -  <fo:block font-size="12pt" xsl:use-attribute-sets="normal.header">
  -        <xsl:value-of select="@name"/>
  -  </fo:block>
  -
  -  <xsl:apply-templates/>
  -
  -</xsl:template>
  -
  -<xsl:template match="p">
  -
  -    <fo:block font-size="10pt" xsl:use-attribute-sets="normal.paragraph">
  -        <xsl:apply-templates/>
  -    </fo:block>
  -
  -</xsl:template>
  -
  -<xsl:template match="source">
  -
  -    <fo:block font-size="10pt" xsl:use-attribute-sets="normal.pre">
  -        <xsl:apply-templates/>
  -    </fo:block>
  -
  -</xsl:template>
  -
  -<xsl:template match="[EMAIL PROTECTED]">
  -    <fo:block>
  -        <fo:external-graphic src="[EMAIL PROTECTED]"/>
  -    </fo:block>
  -</xsl:template>
  -
  -<xsl:template match="table">
  -  <!-- FIXME: Do Nothing is not acceptable -->
  -<!-- realistically, FOP doesn't support tables with auto, so we can
  -     short term, count the number of td's or th's in the first row
  -     and use that as a guide for an evenly spaced table
  -  <fo:table>
  -    <fo:table-column column-width="1cm"/>
  -    <fo:table-column column-width="13cm"/>
  -    <fo:table-column column-width="1cm"/>
  -
  -    <fo:table-body>
  -         <xsl:apply-templates mode="toc"/>
  -
  -    </fo:table-body>
  -
  -  </fo:table>
  --->
  -</xsl:template>
  -
  -<!-- XHTML stuff -->
  -
  -<xsl:template match="[EMAIL PROTECTED]">
  -    <fo:basic-link external-destination="[EMAIL PROTECTED]">
  -        <fo:inline color="blue">
  -            <xsl:apply-templates />
  -        </fo:inline>
  -    </fo:basic-link>
  -</xsl:template>
  -
  -<xsl:template match="br">
  -    <fo:block/>
  -</xsl:template>
  -
  -<xsl:template match="em|i">
  -    <fo:inline font-style="italic">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="strong|b">
  -    <fo:inline font-weight="bold">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="sub">
  -    <fo:inline baseline-shift="sub">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="sup">
  -    <fo:inline baseline-shift="sup">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="tt|code">
  -    <fo:inline font-family="monospace">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="big">
  -    <fo:inline font-size="larger">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:template match="small">
  -    <fo:inline font-size="smaller">
  -        <xsl:apply-templates />
  -    </fo:inline>
  -</xsl:template>
  -
  -<xsl:attribute-set name="list">
  -    <xsl:attribute name="provisional-distance-between-starts">
  -        1em
  -    </xsl:attribute>
  -    <xsl:attribute name="provisional-label-separation">
  -        1em
  -    </xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="list.item">
  -    <xsl:attribute name="start-indent">inherit</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="dl">
  -<!--    <xsl:attribute name="start-indent">inherit</xsl:attribute>
  -    <xsl:attribute name="end-indent">inherit</xsl:attribute>
  -    -->
  -    <xsl:attribute name="start-indent">1em</xsl:attribute>
  -    <xsl:attribute name="end-indent">1em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="dt">
  -<!--    <xsl:attribute name="start-indent">inherit</xsl:attribute>
  -    <xsl:attribute name="end-indent">inherit</xsl:attribute>
  --->    <xsl:attribute name="start-indent">1em</xsl:attribute>
  -    <xsl:attribute name="end-indent">1em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:attribute-set name="dd">
  -    <xsl:attribute name="start-indent">1em</xsl:attribute>
  -<!--    <xsl:attribute name="start-indent">inherit +1em</xsl:attribute> 
  -    <xsl:attribute name="end-indent">inherit</xsl:attribute>-->
  -    <xsl:attribute name="end-indent">1em</xsl:attribute>
  -    <xsl:attribute name="space-before">0.6em</xsl:attribute>
  -    <xsl:attribute name="space-after">0.6em</xsl:attribute>
  -</xsl:attribute-set>
  -
  -<xsl:template match="ul">
  -    <fo:list-block xsl:use-attribute-sets="list">
  -        <xsl:apply-templates/>
  -    </fo:list-block>
  -</xsl:template>
  -
  -<xsl:template match="ul/li">
  -    <fo:list-item>
  -        <fo:list-item-label xsl:use-attribute-sets="list-item"
  -                            end-indent="label-end()">
  -            <fo:block font-size="10pt">
  -                <fo:character character="&#x2022;" />
  -            </fo:block>
  -        </fo:list-item-label>
  -        <fo:list-item-body start-indent="body-start()">
  -            <fo:block font-size="10pt">
  -                <xsl:apply-templates/>
  -            </fo:block>
  -        </fo:list-item-body>
  -    </fo:list-item>
  -</xsl:template>
  -
  -<xsl:template match="ol">
  -    <fo:list-block  xsl:use-attribute-sets="list">
  -        <xsl:apply-templates />
  -    </fo:list-block>
  -</xsl:template>
  -
  -<xsl:template match="ol/li">
  -    <fo:list-item>
  -        <fo:list-item-label xsl:use-attribute-sets="list-item" 
end-indent="label-end()">
  -            <fo:block font-size="10pt">
  -                <xsl:number format="1." />
  -            </fo:block>
  -        </fo:list-item-label>
  -        <fo:list-item-body start-indent="body-start()">
  -            <fo:block font-size="10pt">
  -                <xsl:apply-templates/>
  -            </fo:block>
  -        </fo:list-item-body>
  -    </fo:list-item>
  -</xsl:template>
  -
  -
  -<xsl:template match="dl">
  -    <fo:block font-size="10pt" xsl:use-attribute-sets="dl">
  -        <xsl:apply-templates />
  -    </fo:block>
  -</xsl:template>
  -
  -
  -<xsl:template match="dt">
  -    <fo:block font-size="10pt" xsl:use-attribute-sets="dt">
  -        <xsl:apply-templates />
  -    </fo:block>
  -</xsl:template>
  -
  -<xsl:template match="dd">
  -    <fo:block font-size="10pt" xsl:use-attribute-sets="dd">
  -        <xsl:apply-templates />
  -    </fo:block>
  -</xsl:template>
  +      </fo:page-sequence>
  +    </xsl:if>
  +  </xsl:template>
   
   </xsl:stylesheet>
  +
  
  
  
  1.6       +7 -0      maven-plugins/pdf/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/pdf/xdocs/changes.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- changes.xml       29 Sep 2003 06:27:57 -0000      1.5
  +++ changes.xml       15 Jan 2004 13:56:34 -0000      1.6
  @@ -6,6 +6,13 @@
     </properties>
   
     <body>
  +    <release version="2.0" date="In CVS">
  +      <action dev="evenisse" type="update">
  +        MAVEN-MPPDF-1. Completely re-writte of the PDF plug-in. It solves most of 
the thorniest
  +        issues, such as table formatting, more levels in the table of contents,
  +        and image sizing. The graphic design is also dramatically improved.
  +      </action>
  +    </release>
       <release version="1.2" date="2003-09-29">
         <action dev="dion" type="update">update to use 
maven.docs.*/maven.gen.docs</action>
       </release>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to