forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r190343 - in /forrest/trunk: main/fresh-site/src/documentation/skinconf.xml main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd main/webapp/skins/common/skinconf.xsl main/webapp/skins/common/xslt/fo/document2fo.xsl site-author/skinconf.xml site-author/status.xml
Date Mon, 13 Jun 2005 04:17:22 GMT
Author: crossley
Date: Sun Jun 12 21:17:20 2005
New Revision: 190343

URL: http://svn.apache.org/viewcvs?rev=190343&view=rev
Log:
Enable skinconf to specify optional page number format for PDF.
Submitted by: Cyriaque Dupoirieux
Issue: FOR-355 Improved PDF configurability: display the pdf page number using a format.

Modified:
    forrest/trunk/main/fresh-site/src/documentation/skinconf.xml
    forrest/trunk/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd
    forrest/trunk/main/webapp/skins/common/skinconf.xsl
    forrest/trunk/main/webapp/skins/common/xslt/fo/document2fo.xsl
    forrest/trunk/site-author/skinconf.xml
    forrest/trunk/site-author/status.xml

Modified: forrest/trunk/main/fresh-site/src/documentation/skinconf.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/fresh-site/src/documentation/skinconf.xml?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/skinconf.xml (original)
+++ forrest/trunk/main/fresh-site/src/documentation/skinconf.xml Sun Jun 12 21:17:20 2005
@@ -343,6 +343,20 @@
     -->
     <page size="letter" orientation="portrait" text-align="left"/>
 
+    <!-- 
+       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)"
+    -->
+    <page-numbering-format>Page 1</page-numbering-format>
+
     <!--
        Margins can be specified for top, bottom, inner, and outer
        edges. If double-sided="false", the inner edge is always left

Modified: forrest/trunk/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd (original)
+++ forrest/trunk/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd Sun Jun 12 21:17:20
2005
@@ -123,12 +123,12 @@
                   current CDATA #IMPLIED
                   align  CDATA #IMPLIED>
   <!ELEMENT extra-css (#PCDATA)>
-  <!ELEMENT pdf (page, margins?, show-external-urls?, disable-copyright-footer?)>
+  <!ELEMENT pdf (page, page-numbering-format?, margins?, show-external-urls?, disable-copyright-footer?)>
   <!ELEMENT page EMPTY>
   <!ATTLIST page size (a0|a1|a2|a3|a4|a5|executive|folio|legal|ledger|letter|quarto|tabloid)
"letter"
             orientation (portrait|landscape) "portrait"
             text-align (left|right|justify) "left">
-
+  <!ELEMENT page-numbering-format (#PCDATA)>
   <!ELEMENT margins (top?, bottom?, inner?, outer?)>
   <!ATTLIST margins double-sided (true | false) "false">
   <!ELEMENT top (#PCDATA)>

Modified: forrest/trunk/main/webapp/skins/common/skinconf.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/skinconf.xsl?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/main/webapp/skins/common/skinconf.xsl (original)
+++ forrest/trunk/main/webapp/skins/common/skinconf.xsl Sun Jun 12 21:17:20 2005
@@ -99,6 +99,10 @@
          <toc level="2" location="page"/>
       </xsl:if>
 
+    <xsl:if test="not(pdf/page-numbering-format)">
+        <pdf><page-numbering-format>Page 1</page-numbering-format></pdf>
+    </xsl:if>
+
     <xsl:if test="not(pdf/show-external-urls)">
         <pdf><show-external-urls>true</show-external-urls></pdf>
     </xsl:if>

Modified: forrest/trunk/main/webapp/skins/common/xslt/fo/document2fo.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/fo/document2fo.xsl?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/fo/document2fo.xsl (original)
+++ forrest/trunk/main/webapp/skins/common/xslt/fo/document2fo.xsl Sun Jun 12 21:17:20 2005
@@ -66,6 +66,9 @@
   <!-- page breaks after TOC and each page if an aggregate document -->
   <xsl:variable name="page-break-top-sections" select="'true'"/>
 
+  <!-- page numbering format -->
+  <xsl:variable name="page-numbering-format" select="string(//skinconfig/pdf/page-numbering-format)"/>
+
   <!-- Section depth at which we stop numbering and just indent -->
   <xsl:param name="numbering-max-depth" select="'3'"/>
   <xsl:param name="imagesdir" select="."/>
@@ -271,12 +274,9 @@
       </fo:block>
       <!-- don't list page number on first page if it's contents is just the TOC -->
       <xsl:if test="not($toc-max-depth > 0 and $page-break-top-sections)">
-      <fo:block
-        font-size="70%"
-        text-align="start">
-          <!-- insert i18n stuff here -->
-        Page <fo:page-number/>
-      </fo:block>
+        <xsl:call-template name="insertPageNumber">
+          <xsl:with-param name="text-align">start</xsl:with-param>
+        </xsl:call-template>
       </xsl:if>
       <xsl:call-template name="info"/>
     </fo:static-content>
@@ -297,12 +297,9 @@
         text-align="center">
         <xsl:apply-templates select="footer"/>
       </fo:block>
-      <fo:block
-        font-size="70%"
-        text-align="end">
-        <!-- insert i18n stuff here -->
-        Page <fo:page-number/>
-      </fo:block>
+      <xsl:call-template name="insertPageNumber">
+        <xsl:with-param name="text-align">end</xsl:with-param>
+      </xsl:call-template>
       <xsl:call-template name="info"/>
     </fo:static-content>
 
@@ -322,12 +319,9 @@
         text-align="center">
         <xsl:apply-templates select="footer"/>
       </fo:block>
-      <fo:block
-        font-size="70%"
-        text-align="start">
-        <!-- insert i18n stuff here -->
-        Page <fo:page-number/>
-      </fo:block>
+      <xsl:call-template name="insertPageNumber">
+        <xsl:with-param name="text-align">start</xsl:with-param>
+      </xsl:call-template>
       <xsl:call-template name="info"/>
     </fo:static-content>
 
@@ -348,6 +342,10 @@
         padding-after="18pt">
         <xsl:apply-templates/>
       </fo:block>
+      
+      <!-- Total number of pages calculation... -->
+      <fo:block id="term"/>
+
     </fo:flow>
   </xsl:template>
 
@@ -1014,6 +1012,31 @@
       </xsl:if>
  </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>
+ 
 <!-- ====================================================================== -->
 <!-- Temporary section - subject to change on short notice  -->
 <!-- ====================================================================== -->

Modified: forrest/trunk/site-author/skinconf.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/site-author/skinconf.xml?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/site-author/skinconf.xml (original)
+++ forrest/trunk/site-author/skinconf.xml Sun Jun 12 21:17:20 2005
@@ -183,6 +183,20 @@
     -->
     <page size="a4" orientation="portrait" text-align="left"/>
 
+    <!-- 
+       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)"
+    -->
+    <page-numbering-format>Page 1/1</page-numbering-format>
+
     <!--
        Margins can be specified for top, bottom, inner, and outer
        edges. If double-sided="false", the inner edge is always left

Modified: forrest/trunk/site-author/status.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/site-author/status.xml?rev=190343&r1=190342&r2=190343&view=diff
==============================================================================
--- forrest/trunk/site-author/status.xml (original)
+++ forrest/trunk/site-author/status.xml Sun Jun 12 21:17:20 2005
@@ -129,8 +129,11 @@
         Added document to facilitate
         <link href="site:upgrading_07">upgrading to v0.7</link>
       </action>
+      <action context="code" type="update" dev="DC" due-to="Cyriaque Dupoirieux" fixes-bug="FOR-355">
+          Enable skinconf to specify optional page number format for PDF.
+       </action>
       <action context="code" type="add" dev="RDG" fixes-bug="FOR-528">
-          Plugins are no version controlled.
+          Plugins are now version controlled.
        </action>
       <action context="code" type="update" dev="JJP" due-to="Cyriaque Dupoirieux" fixes-bug="FOR-514">
           Do not limit status.xml contexts in projectInfo plugin.



Mime
View raw message