Added:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft?view=auto&rev=518640
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft
(added)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft
Thu Mar 15 07:33:47 2007
@@ -0,0 +1,140 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="page-footer-numbering">
+ <description>
+ <p>page-footer-numbering defines the page numbering format of the pdf
document..</p>
+ </description>
+ <usage>
+ <![CDATA[<forrest:contract name="page-footer-numbering">
+ [<forrest:property
name="skip-first-page-numbering">[true|false]</forrest:property>]
+ <!--
+ Pattern of the page numbering in the footer - Default is "Page x".
+ first occurrence of '1' digit represents the current page number,
+ second occurrence of '1' digit represents the total page number,
+ anything else is considered as the static part of the numbering
pattern.
+ Examples : x is the current page number, y the total page number.
+ <page-numbering-format>none</page-numbering-format> Do not displays
the page numbering
+ <page-numbering-format>1</page-numbering-format> Displays "x"
+ <page-numbering-format>p1.</page-numbering-format> Displays "px."
+ <page-numbering-format>Page 1/1</page-numbering-format> Displays "Page
x/y"
+ <page-numbering-format>(1-1)</page-numbering-format> Displays "(x-y)"
+ -->
+ [<forrest:property name="page-numbering-format">Page
1</forrest:property>]
+ </forrest:contract>]]>
+ </usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="page-footer-numbering" inputFormat="xsl">
+ <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="skip-first-page-numbering" select="'true'"/>
+ <xsl:param name="page-numbering-format" select="'Page 1'"/>
+
+ <xsl:template match="/">
+ <forrest:content>
+ <forrest:part xpath="/fo/static-content">
+
+ <fo:static-content flow-name="first-footer">
+ <fo:block border-top="0.25pt solid"
+ padding-before="6pt" text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+
+ <!-- don't list page number on first page if it's contents is
just the TOC -->
+ <xsl:if
+ test="not($skip-first-page-numbering)">
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">
+ start</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </fo:static-content>
+
+ <fo:static-content flow-name="even-footer">
+ <fo:block border-top="0.25pt solid"
+ padding-before="6pt" text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">
+ end</xsl:with-param>
+ </xsl:call-template>
+ </fo:static-content>
+
+ <fo:static-content flow-name="odd-footer">
+ <fo:block border-top="0.25pt solid"
+ padding-before="6pt" text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">
+ start</xsl:with-param>
+ </xsl:call-template>
+ </fo:static-content>
+
+ </forrest:part>
+ </forrest:content>
+
+ </xsl:template>
+
+ <!-- Display the document numerotation -->
+ <xsl:template name="insertPageNumber">
+ <xsl:param name="text-align" select="'start'"/>
+ <xsl:variable name="prefixe"
+ select="substring-before($page-numbering-format,'1')"/>
+ <xsl:variable name="sep"
+
select="substring-before(substring-after($page-numbering-format,'1'),'1')"/>
+ <xsl:variable name="postfixe">
+ <xsl:choose>
+ <xsl:when
+ test="contains(substring-after($page-numbering-format,'1'),'1')">
+ <xsl:value-of
+
select="substring-after(substring-after($page-numbering-format,'1'),'1')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="substring-after($page-numbering-format,'1')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- if 'page-numbering-format' contains 1 digits, the page number is
displayed in the footer -->
+ <xsl:if test="contains($page-numbering-format,'1')">
+ <fo:block font-size="70%"
+ text-align="{$text-align}">
+
+ <!-- if the separator is not found, the total page number is
skipped -->
+ <xsl:value-of select="$prefixe"/>
+ <fo:page-number/>
+ <xsl:if test="$sep != ''">
+ <xsl:value-of select="$sep"/>
+ <fo:page-number-citation ref-id="term"/>
+ </xsl:if>
+ <xsl:value-of select="$postfixe"/>
+ </fo:block>
+ </xsl:if>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
Propchange:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft?view=auto&rev=518640
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
(added)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
Thu Mar 15 07:33:47 2007
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="page-header">
+ <description>
+ <p>page-header define the header of the pdf.</p>
+ </description>
+ <usage>
+ <![CDATA[<forrest:contract name="page-header"
+ dataURI="cocoon://#{$getRequest}.title.xml"/>]]>
+ </usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="page-header" inputFormat="xsl">
+ <xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:template match="/">
+ <forrest:content>
+ <forrest:part xpath="/fo/page-sequence">
+ <fo:static-content flow-name="even-header">
+ <fo:block font-size="70%" text-align="end"
+ font-style="italic">
+ <xsl:value-of select="title"/>
+ </fo:block>
+ </fo:static-content>
+ <fo:static-content flow-name="odd-header">
+ <fo:block font-size="70%" text-align="start"
+ font-style="italic">
+ <xsl:value-of select="title"/>
+ </fo:block>
+ </fo:static-content>
+ </forrest:part>
+ </forrest:content>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
Propchange:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/common-fo.vt.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/common-fo.vt.xml?view=diff&rev=518640&r1=518639&r2=518640
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/common-fo.vt.xml
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/common-fo.vt.xml
Thu Mar 15 07:33:47 2007
@@ -1,20 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
- <forrest:contract name="content"
- dataURI="cocoon://#{$getRequest}.xml">
+ <!-- Settings specific to PDF output. -->
+ <forrest:contract name="layout-master-set">
<forrest:property name="config">
- <!-- Settings specific to PDF output. -->
<!--
Supported page sizes are a0, a1, a2, a3, a4, a5, executive,
folio, legal, ledger, letter, quarto, tabloid (default letter).
Supported page orientations are portrait, landscape (default
portrait).
- Supported text alignments are left, right, justify (default left).
-->
- <page size="letter" orientation="portrait"
- text-align="left" background-color="#ffffff"/>
-
+ <page size="a4" orientation="portrait"/>
+ <!--
+ Margins can be specified for top, bottom, inner, and outer
+ edges. If double-sided="false", the inner edge is always left
+ and the outer is always right. If double-sided="true", the
+ inner edge will be left on odd pages, right on even pages,
+ the outer edge vice versa.
+ Specified below are the default settings.
+ -->
+ <margins double-sided="false">
+ <top>1in</top>
+ <bottom>1in</bottom>
+ <inner>1.25in</inner>
+ <outer>1in</outer>
+ </margins>
+ </forrest:property>
+ </forrest:contract>
+ <forrest:contract name="content-title"
dataURI="cocoon://#{$getRequest}.title.xml"/>
+ <forrest:contract name="page-header"
dataURI="cocoon://#{$getRequest}.title.xml"/>
+ <forrest:contract name="page-footer-numbering">
<!--
Pattern of the page numbering in the footer - Default is "Page x".
first occurrence of '1' digit represents the current page number,
@@ -27,50 +42,63 @@
<page-numbering-format>Page 1/1</page-numbering-format> Displays "Page
x/y"
<page-numbering-format>(1-1)</page-numbering-format> Displays "(x-y)"
-->
- <page-numbering-format>Page 1</page-numbering-format>
+ <forrest:property
name="skip-first-page-numbering">true</forrest:property>
+ <forrest:property name="page-numbering-format">1/1</forrest:property>
+ </forrest:contract>
+ <forrest:contract name="page-footer-copyright">
+ <forrest:property name="copyright">
+ <!-- The following are used to construct a copyright statement as
follows :
+ <property> <symbol> <year> <vendor> <msg>
+ <url>
+ ie. Copyright c 2002 ACME
+ http://ACME.org
+ inception year option let you create a copyright with a range of date
automaticalculated :
+ 2002-2007
+ -->
+ <year inception='true'>2002</year>
+ <vendor>ACME</vendor>
+ <url>http://ACME.org</url>
+ <msg>Tous droits réservés.</msg>
+ <symbol></symbol>
+ <property></property>
+ </forrest:property>
+ </forrest:contract>
+ <forrest:contract name="content-abstract"
dataURI="cocoon://#{$getRequest}.abstract.xml"/>
+ <forrest:contract name="content-notice"
dataURI="cocoon://#{$getRequest}.notice.xml"/>
+ <forrest:contract name="content-authors"
dataURI="cocoon://#{$getRequest}.authors.xml"/>
+ <forrest:contract name="content-toc"
dataURI="cocoon://#{$getRequest}.toc.xml">
<!-- Configure the TOC, i.e. the Table of Contents.
@max-depth
how many "section" levels need to be included in the
- generated Table of Contents (TOC).
+ generated Table of Contents (TOC).
+ (default is 2)
+ @page-break-after (default is true)
+ jump to the next page after the TOC.
+ (default is true)
@min-sections
Minimum required to create a TOC.
- @location ("page","menu","page,menu", "none")
- Where to show the TOC.
+ (FIXME min-section is not managed yet)
-->
- <toc max-depth="2" min-sections="1" location="page"/>
-
-
- <!-- Heading types can be clean|underlined|boxed -->
- <headings type="boxed" color="#4a6d8c"/>
- <!--
- Margins can be specified for top, bottom, inner, and outer
- edges. If double-sided="false", the inner edge is always left
- and the outer is always right. If double-sided="true", the
- inner edge will be left on odd pages, right on even pages,
- the outer edge vice versa.
- Specified below are the default settings.
+ <forrest:property name="max-depth">2</forrest:property>
+ <forrest:property name="page-break-after">true</forrest:property>
+ </forrest:contract>
+ <forrest:contract name="content-main-outline"
dataURI="cocoon://#{$getRequest}.toc.xml"/>
+ <forrest:contract name="content-main"
dataURI="cocoon://#{$getRequest}.source.rewritten.xml">
+ <forrest:property name="config">
+ <!--
+ Supported text alignments are left, right, justify (default left).
-->
- <margins double-sided="false">
- <top>1in</top>
- <bottom>1in</bottom>
- <inner>1.25in</inner>
- <outer>1in</outer>
- </margins>
-
+ <page text-align="left" background-color="#ffffff"/>
+
+ <!-- Heading types can be clean|underlined|boxed -->
+ <headings type="underlined" color="#4a6d8c"/>
+
<!--
Print the URL text next to all links going outside the file
-->
<show-external-urls>false</show-external-urls>
-
- <!--
- Disable the copyright footer on each page of the PDF.
- A footer is composed for each page. By default, a "credit" with
role=pdf
- will be used, as explained below. Otherwise a copyright statement
- will be generated. This latter can be disabled.
- -->
- <disable-copyright-footer>
- false</disable-copyright-footer>
- <colors>
+
+ <colors>
<color name="code" value="#CFDCED"/>
<color name="highlight" value="#ffff00"/>
<color name="fixme" value="#cc6600"/>
@@ -81,13 +109,7 @@
<color name="body" value="#ffffff" link="#0F3660"
vlink="#009999" hlink="#000066"/>
</colors>
-
- <!-- The following are used to construct a copyright statement -->
- <disable-copyright-footer>
- false</disable-copyright-footer>
- <year>2006</year>
- <vendor>ACME</vendor>
- <url>http://ACME.org</url>
+
</forrest:property>
</forrest:contract>
-</forrest:template>
\ No newline at end of file
+</forrest:template>