forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject svn commit: rev 22844 - in forrest/trunk: . src/core/context src/core/context/skins/common/xslt/fo
Date Mon, 12 Jul 2004 18:37:54 GMT
Author: brondsem
Date: Mon Jul 12 11:37:53 2004
New Revision: 22844

Modified:
   forrest/trunk/src/core/context/sitemap.xmap
   forrest/trunk/src/core/context/skins/common/xslt/fo/document2fo.xsl
   forrest/trunk/src/core/context/skins/common/xslt/fo/footerinfo.xsl
   forrest/trunk/status.xml
Log:
use skinconf pipeline to FO (pdf), fixes FOR-138; add a .fo matcher for easier document2fo
testing

Modified: forrest/trunk/src/core/context/sitemap.xmap
==============================================================================
--- forrest/trunk/src/core/context/sitemap.xmap	(original)
+++ forrest/trunk/src/core/context/sitemap.xmap	Mon Jul 12 11:37:53 2004
@@ -433,7 +433,10 @@
       </map:match>
 
       <map:match type="regexp" pattern="^(.*?)([^/]*).pdf$">
-        <map:generate src="cocoon:/{1}{2}.xml"/>
+        <map:aggregate element="site">
+          <map:part src="cocoon:/skinconf.xml"/>
+          <map:part src="cocoon:/{1}{2}.xml"/>
+        </map:aggregate>
         <!-- <map:transform type="idgen"/> -->
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.pdf"/>
@@ -441,27 +444,55 @@
         <map:select type="exists">
           <map:when test="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
             <map:transform src="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
-              <map:parameter name="config-file" value="{project:skinconf}"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
           <map:when test="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
             <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
-              <map:parameter name="config-file" value="{project:skinconf}"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
           <map:otherwise>
             <map:transform src="{forrest:context}/skins/common/xslt/fo/document2fo.xsl">
-              <map:parameter name="config-file" value="{project:skinconf}"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:otherwise>
         </map:select>
         <map:serialize type="fo2pdf"/>
+      </map:match>
+
+      <map:match type="regexp" pattern="^(.*?)([^/]*).fo$">
+        <map:aggregate element="site">
+          <map:part src="cocoon:/skinconf.xml"/>
+          <map:part src="cocoon:/{1}{2}.xml"/>
+        </map:aggregate>
+        <!-- <map:transform type="idgen"/> -->
+        <map:transform type="xinclude"/>
+        <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.fo"/>
+        <map:select type="exists">
+          <map:when test="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
+            <map:transform src="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
+              <map:parameter name="imagesdir" value="{project:resources.images}/"/>
+              <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
+            </map:transform>
+          </map:when>
+          <map:when test="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+            <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+              <map:parameter name="imagesdir" value="{project:resources.images}/"/>
+              <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
+            </map:transform>
+          </map:when>
+          <map:otherwise>
+            <map:transform src="{forrest:context}/skins/common/xslt/fo/document2fo.xsl">
+              <map:parameter name="imagesdir" value="{project:resources.images}/"/>
+              <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
+            </map:transform>
+          </map:otherwise>
+        </map:select>
+        <map:serialize type="xml"/>
       </map:match>
 
       <map:match type="regexp" pattern="^(.*?)([^/]*).svg$">

Modified: forrest/trunk/src/core/context/skins/common/xslt/fo/document2fo.xsl
==============================================================================
--- forrest/trunk/src/core/context/skins/common/xslt/fo/document2fo.xsl	(original)
+++ forrest/trunk/src/core/context/skins/common/xslt/fo/document2fo.xsl	Mon Jul 12 11:37:53
2004
@@ -19,43 +19,40 @@
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
                 version="1.0">
 
-  <!-- the skinconf file -->
-  <xsl:param name="config-file"/>
-  <xsl:variable name="config" select="document('$config-file')/skinconfig"/>
   <!-- Get the section depth to use when generating the minitoc (default is 2) -->
-  <xsl:variable name="toc-max-depth" select="number($config/toc/@max-depth)"/>
+  <xsl:variable name="toc-max-depth" select="number(//skinconfig/toc/@max-depth)"/>
 
   <!-- The page size to be used -->
   <xsl:variable name="pagesize"
-                select="string($config/pdf/page/@size)"/>
+                select="string(//skinconfig/pdf/page/@size)"/>
 
   <!-- The page orientation ("portrait" or "landscape") -->
   <xsl:variable name="pageorientation"
-                select="string($config/pdf/page/@orientation)"/>
+                select="string(//skinconfig/pdf/page/@orientation)"/>
 
   <!-- Double-sided printing toggle -->
   <xsl:variable name="doublesided"
-                select="string($config/pdf/margins/@double-sided)"/>
+                select="string(//skinconfig/pdf/margins/@double-sided)"/>
 
   <!-- The top page margin -->
   <xsl:variable name="topmargin"
-                select="string($config/pdf/margins/top)"/>
+                select="string(//skinconfig/pdf/margins/top)"/>
 
   <!-- The bottom page margin -->
   <xsl:variable name="bottommargin"
-                select="string($config/pdf/margins/bottom)"/>
+                select="string(//skinconfig/pdf/margins/bottom)"/>
 
   <!-- The inner page margin (always the left margin if
   double-sided printing is off, alternating between left and right if
   it's on) -->
   <xsl:variable name="innermargin"
-                select="string($config/pdf/margins/inner)"/>
+                select="string(//skinconfig/pdf/margins/inner)"/>
 
   <!-- The outer page margin (always the right margin if
   double-sided printing is off, alternating between right and left if
   it's on)-->
   <xsl:variable name="outermargin"
-                select="string($config/pdf/margins/outer)"/>
+                select="string(//skinconfig/pdf/margins/outer)"/>
 
 
   <xsl:param name="numbersections" select="'true'"/>
@@ -244,11 +241,10 @@
         </fo:page-sequence-master>
       </fo:layout-master-set>
 
-      <xsl:apply-templates select="/document" mode="outline"/>
+      <xsl:apply-templates select="/site/document" mode="outline"/>
 
       <fo:page-sequence master-reference="book">
-        <fo:title><xsl:value-of select="document/header/title"/></fo:title>
-        <xsl:apply-templates/>
+        <xsl:apply-templates select="/site/document"/>
       </fo:page-sequence>
 
     </fo:root>

Modified: forrest/trunk/src/core/context/skins/common/xslt/fo/footerinfo.xsl
==============================================================================
--- forrest/trunk/src/core/context/skins/common/xslt/fo/footerinfo.xsl	(original)
+++ forrest/trunk/src/core/context/skins/common/xslt/fo/footerinfo.xsl	Mon Jul 12 11:37:53
2004
@@ -28,19 +28,15 @@
   <url>http://xml.apache.org/fop/dev/</url>
 </credit>
 -->
-
-  <xsl:param name="config-file"/>
-  <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="pdfcredit" select="//skinconfig/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 &#169; </xsl:text><xsl:value-of select="$config/year"/>&#160;<xsl:value-of
-          select="$config/vendor"/><xsl:text> All rights reserved.</xsl:text>
+        <xsl:text>Copyright &#169; </xsl:text><xsl:value-of select="//skinconfig/year"/>&#160;<xsl:value-of
+          select="//skinconfig/vendor"/><xsl:text> All rights reserved.</xsl:text>
       </xsl:if>
     </xsl:variable>
     <xsl:variable name="url" select="$pdfcredit/url"/>

Modified: forrest/trunk/status.xml
==============================================================================
--- forrest/trunk/status.xml	(original)
+++ forrest/trunk/status.xml	Mon Jul 12 11:37:53 2004
@@ -49,6 +49,9 @@
         Added new document to facilitate
         <link href="site:upgrading_06">upgrading to v0.6</link>
       </action>
+      <action dev="DB" type="fix" context="code" fixes-bug="FOR-138">
+        PDF pages recieve skinconf properly (through the skinconf pipeline).
+      </action>
       <action dev="DB" type="fix" context="code" fixes-bug="FOR-154">
         FAQ page does not provide it's own extra index.
       </action>

Mime
View raw message