You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/01/10 14:51:56 UTC
cvs commit: xml-forrest/src/resources/skins/common/xslt/html site2xhtml.xsl
jefft 2003/01/10 05:51:56
Modified: . status.xml
src/resources/conf skinconf.xml
src/resources/fresh-site/src/documentation skinconf.xml
src/resources/skins/common/xslt/fo document2fo.xsl
src/resources/skins/common/xslt/html site2xhtml.xsl
Added: src/resources/skins/common/xslt/fo footerinfo.xsl
Log:
Add copyright or (if present) tool credit msg to PDF footer.
Revision Changes Path
1.89 +5 -0 xml-forrest/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/xml-forrest/status.xml,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- status.xml 9 Jan 2003 15:46:36 -0000 1.88
+++ status.xml 10 Jan 2003 13:51:55 -0000 1.89
@@ -24,6 +24,11 @@
<changes>
<release version="0.3-dev" date="unreleased">
+ <action dev="JT" type="add" context="skins">
+ Added copyright statement to PDF footer (10pt, light-grey text). if a
+ skinconf.xml 'credit' element has a role='pdf' attribute, this text will
+ be used instead. Thanks to Keiron Liddle.
+ </action>
<action dev="JT" type="fix" context="shbat">
Now all files in <code>src/documentation/content</code> (except xdocs)
and <code>src/documentation/resources/images</code> are copied across
1.8 +10 -2 xml-forrest/src/resources/conf/skinconf.xml
Index: skinconf.xml
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/skinconf.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- skinconf.xml 15 Nov 2002 04:19:50 -0000 1.7
+++ skinconf.xml 10 Jan 2003 13:51:55 -0000 1.8
@@ -9,9 +9,14 @@
<!ENTITY % links.att 'name CDATA #REQUIRED'>
<!ENTITY % link.att 'name CDATA #REQUIRED href CDATA #REQUIRED'>
- <!ELEMENT skinconfig (disable-search?, searchsite-domain?, searchsite-name?, project-name, project-url, project-logo, group-name?, group-url?, group-logo?, host-url?, host-logo?, year?, vendor?, trail?, credits?)*>
+ <!ELEMENT skinconfig (disable-search?, searchsite-domain?, searchsite-name?,
+ project-name, project-url, project-logo, group-name?, group-url?, group-logo?,
+ host-url?, host-logo?, year?, vendor?, trail?, credits?)*>
<!ELEMENT credits (credit*)>
- <!ELEMENT credit (name, url, image, width?, height?)>
+ <!ELEMENT credit (name, url, image?, width?, height?)>
+ <!-- id uniquely identifies the tool, and role indicates its function -->
+ <!ATTLIST credit id CDATA #IMPLIED
+ role CDATA #IMPLIED>
<!ELEMENT disable-search (#PCDATA)>
<!ELEMENT searchsite-domain (#PCDATA)>
<!ELEMENT searchsite-name (#PCDATA)>
@@ -86,5 +91,8 @@
<width>88</width>
<height>31</height>
</credit>
+ <!-- A credit with @role='pdf' will have its name and url displayed in the
+ PDF page's footer. -->
</credits>
+
</skinconfig>
1.6 +10 -2 xml-forrest/src/resources/fresh-site/src/documentation/skinconf.xml
Index: skinconf.xml
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/fresh-site/src/documentation/skinconf.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- skinconf.xml 17 Nov 2002 10:46:55 -0000 1.5
+++ skinconf.xml 10 Jan 2003 13:51:56 -0000 1.6
@@ -9,9 +9,14 @@
<!ENTITY % links.att 'name CDATA #REQUIRED'>
<!ENTITY % link.att 'name CDATA #REQUIRED href CDATA #REQUIRED'>
- <!ELEMENT skinconfig (disable-search?, searchsite-domain?, searchsite-name?, project-name, project-url, project-logo, group-name?, group-url?, group-logo?, host-url?, host-logo?, year?, vendor?, trail?, credits?)*>
+ <!ELEMENT skinconfig (disable-search?, searchsite-domain?, searchsite-name?,
+ project-name, project-url, project-logo, group-name?, group-url?, group-logo?,
+ host-url?, host-logo?, year?, vendor?, trail?, credits?)*>
<!ELEMENT credits (credit*)>
- <!ELEMENT credit (name, url, image, width?, height?)>
+ <!ELEMENT credit (name, url, image?, width?, height?)>
+ <!-- id uniquely identifies the tool, and role indicates its function -->
+ <!ATTLIST credit id CDATA #IMPLIED
+ role CDATA #IMPLIED>
<!ELEMENT disable-search (#PCDATA)>
<!ELEMENT searchsite-domain (#PCDATA)>
<!ELEMENT searchsite-name (#PCDATA)>
@@ -86,5 +91,8 @@
<width>88</width>
<height>31</height>
</credit>
+ <!-- A credit with @role='pdf' will have its name and url displayed in the
+ PDF page's footer. -->
</credits>
+
</skinconfig>
1.5 +5 -1 xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl
Index: document2fo.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- document2fo.xsl 4 Dec 2002 14:14:29 -0000 1.4
+++ document2fo.xsl 10 Jan 2003 13:51:56 -0000 1.5
@@ -5,8 +5,9 @@
version="1.0">
<xsl:output method="xml"/>
-
+
<xsl:include href="pdfoutline.xsl"/>
+ <xsl:include href="footerinfo.xsl"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
@@ -107,6 +108,7 @@
text-align="start">
Page <fo:page-number/>
</fo:block>
+ <xsl:call-template name="info"/>
</fo:static-content>
<fo:static-content flow-name="even-header">
@@ -128,6 +130,7 @@
text-align="end">
Page <fo:page-number/>
</fo:block>
+ <xsl:call-template name="info"/>
</fo:static-content>
<fo:static-content flow-name="odd-header">
@@ -149,6 +152,7 @@
text-align="start">
Page <fo:page-number/>
</fo:block>
+ <xsl:call-template name="info"/>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
1.1 xml-forrest/src/resources/skins/common/xslt/fo/footerinfo.xsl
Index: footerinfo.xsl
===================================================================
<?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">
<!--
Named template to generate a short message in the PDF footer, from text in
skinconf.xml. By default, the message is a copyright statement. If a credit
with @role='pdf' is present, that is used instead. Eg:
<credit role="pdf">
<name>Generated by Apache FOP 1.0-dev</name>
<url>http://xml.apache.org/forrest/fop/dev/</url>
</credit>
-->
<xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
<xsl:variable name="config" select="document($config-file)/skinconfig"/>
<xsl:template name="info">
<xsl:variable name="pdfcredit" select="$config/credits/credit[@role = 'pdf']"/>
<xsl:variable name="text">
<xsl:if test="$pdfcredit">
<xsl:value-of select="$pdfcredit/name"/>
</xsl:if>
<xsl:if test="not($pdfcredit)">
<xsl:text>Copyright © </xsl:text><xsl:value-of select="$config/year"/> <xsl:value-of
select="$config/vendor"/><xsl:text> All rights reserved.</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:message>## text is <xsl:value-of select="$text"/></xsl:message>
<xsl:variable name="url" select="$pdfcredit/url"/>
<xsl:message>## url is <xsl:value-of select="$url"/></xsl:message>
<fo:block-container font-style="italic" absolute-position="absolute"
left="0pt" top="0pt" right="6.25in" bottom="150pt"
font-size="10pt">
<xsl:if test="not($url)">
<fo:block text-align="center" color="lightgrey">
<xsl:value-of select="$text"/>
</fo:block>
</xsl:if>
<xsl:if test="$url">
<fo:block text-align="center">
<fo:basic-link color="lightgrey"
external-destination="{$url}">
<xsl:value-of select="$text"/>
</fo:basic-link>
</fo:block>
<fo:block text-align="center">
<fo:basic-link color="lightgrey"
external-destination="{$url}">
<xsl:value-of select="$url"/>
</fo:basic-link>
</fo:block>
</xsl:if>
</fo:block-container>
</xsl:template>
</xsl:stylesheet>
1.2 +2 -2 xml-forrest/src/resources/skins/common/xslt/html/site2xhtml.xsl
Index: site2xhtml.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/site2xhtml.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- site2xhtml.xsl 16 Nov 2002 20:58:12 -0000 1.1
+++ site2xhtml.xsl 10 Jan 2003 13:51:56 -0000 1.2
@@ -94,7 +94,7 @@
</a>
</xsl:if>
<xsl:if test="$filename = 'index.html' and $config/credits">
- <xsl:for-each select="$config/credits/credit">
+ <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
<xsl:call-template name="renderlogo">
<xsl:with-param name="name" select="name"/>
<xsl:with-param name="url" select="url"/>