From Arnaud Heritier : update the pdf cover with company and project logo

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
evenisse committed 2004-01-27 11:18:03 +00:00
1 parent d0565437cd
commit cad884ae05
6 files changed
+97 -22

No files matched your search

+10 -7
View File
@@ -16,15 +16,18 @@
<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')}"/>
<tstamp>
<format property="coverDate" pattern="${maven.xdoc.date.format}" locale="${maven.xdoc.date.locale}"/>
</tstamp>
<j:set var="projectLogo" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/>
<j:set var="companyLogo" value="${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')}"/>
<j:set var="pdfName" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.pdfName')}"/>
<mkdir dir="${docsPdf}"/>
</goal>
<goal name="fo" prereqs="fo:fo" description="Generate XSL:FO project documentation"/>
<goal name="fo:fo" prereqs="pdf:prepare" description="Generate XSL:FO project documentation">
<goal name="fo" prereqs="fo:fo" description="This simply pre-requisites the fo:fo goal. "/>
<goal name="fo:fo" prereqs="pdf:prepare" description="Generates an fo xml document from the ${maven.pdf.navigationFile} file supplied as part of the documentation. Please note that as yet, no sanity check is done to make sure this file exists.">
<echo>Generating ${docsDest}/project.fo ...</echo>
<available file="${docsToc}" property="maven.fo.navigation.available"/>
<fail message="PDF generation cannot complete as ${docsToc} is missing" unless="maven.fo.navigation.available"/>
@@ -49,7 +52,7 @@
<param name="debug" expression="${debug}"/>
</style>
</goal>
<goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="Generate PDF project documentation"/>
<goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="This is the default goal of the plugin and simply pre-requisites the pdf:pdf goal. "/>
<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}">
@@ -79,7 +82,7 @@
</fileset>
</copy>
</goal>
<goal name="pdf:pdf" description="Generate PDF project documentation" prereqs="pdf:prepare">
<goal name="pdf:pdf" description="Generates a PDF document containing all project documentation. The PDF is generated from the .fo file generated in the fo:fo goal." prereqs="pdf:prepare">
<echo>Generating ${docsPdf}/${pdfName} ...</echo>
<echo>Config file: ${docsPdf}/userconfig.xml</echo>
<java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true" maxmemory="500m">
@@ -101,6 +104,6 @@
<arg value="${docsPdf}/${pdfName}"/>
<sysproperty key="javax.xml.transform.TransformerFactory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
</java>
<copy todir="${docsDest}" file="${docsPdf}/${pdfName}"/>
<copy todir="${docsDest}" file="${docsPdf}/${pdfName}"/>
</goal>
</project>
+2 -3
View File
@@ -12,11 +12,10 @@ maven.pdf.imageDpi=150
maven.pdf.debug=false
maven.pdf.navigationFile=navigation.xml
maven.pdf.pdfName=${pom.artifactId}.pdf
# Reserved for future use...
maven.pdf.cover.projectCompany=${pom.organization.name}
maven.pdf.cover.projectName=${pom.name}
maven.pdf.cover.type=Project Documentation
maven.pdf.cover.version=${pom.currentVersion}
maven.pdf.cover.date=June 2, 2003
maven.pdf.projectLogo=${pom.url}${pom.logo}
maven.pdf.companyLogo=${pom.organization.url}${pom.organization.logo}
maven.pdf.projectLogo=${pom.logo}
maven.pdf.companyLogo=${pom.organization.logo}
+2
View File
@@ -5,3 +5,5 @@ maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.license.licenseFile=${basedir}/../../../LICENSE.txt
maven.pdf.projectLogo=http://maven.apache.org/images/maven.gif
maven.pdf.companyLogo=http://maven.apache.org/images/asf_logo_wide_clear.gif
+2 -2
View File
@@ -7,8 +7,8 @@
<id>maven-pdf-plugin</id>
<name>Maven PDF Plug-in</name>
<currentVersion>2.0-SNAPSHOT</currentVersion>
<description/>
<shortDescription>Java Project Management Tools</shortDescription>
<description>PDF Documentation generator</description>
<shortDescription>Generator of project documentation in PDF Format.</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>
+79 -8
View File
@@ -1,16 +1,87 @@
<?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" version="1.0">
<xsl:variable name="colWidth" select="$maxBodyWidth div 3"/>
<xsl:attribute-set name="cover.title">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cover.subtitle">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:template name="fo-cover">
<fo:page-sequence master-reference="cover-page">
<fo:flow flow-name="xsl-region-body">
<fo:block xsl:use-attribute-sets="body.title" text-align="end">
<xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/>
</fo:block>
<fo:block xsl:use-attribute-sets="body.h1" text-align="end" space-before="24pt" space-after="36pt">
<xsl:value-of select="$coverProjectCompany"/>
</fo:block>
<fo:block xsl:use-attribute-sets="body.h1" text-align="end">
<xsl:value-of select="$coverType"/>
<fo:block text-align="center">
<fo:table table-layout="fixed">
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block text-align="left" vertical-align="bottom">
<fo:external-graphic src="{normalize-space($companyLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block/>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right" vertical-align="bottom">
<fo:external-graphic src="{normalize-space($projectLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="4.75pt" number-columns-spanned="3">
<fo:block line-height="1pt">
<fo:leader xsl:use-attribute-sets="table.heading.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="256pt" display-align="center">
<xsl:value-of select="$coverProjectCompany"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.title" text-align="end" space-before="24pt" display-align="center">
<xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" display-align="center">
<xsl:value-of select="$coverType"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" space-after="36pt" display-align="center">
<xsl:value-of select="$coverDate"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
+2 -2
View File
@@ -17,8 +17,8 @@
<xsl:template name="fo-layouts">
<!-- Defines the layout set -->
<fo:layout-master-set>
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="0.4in" margin-right="0.2in">
<fo:region-body margin-top="4.72in"/>
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-body margin-top="0.7in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="cover-inside" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0in" margin-bottom="0in" margin-left="0in" margin-right="0in">
<fo:region-body margin-top="0in"/>