forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdupoiri...@apache.org
Subject svn commit: r518640 [1/2] - in /forrest/trunk/whiteboard/plugins: org.apache.forrest.plugin.internal.dispatcher/ org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo...
Date Thu, 15 Mar 2007 14:33:49 GMT
Author: cdupoirieux
Date: Thu Mar 15 07:33:47 2007
New Revision: 518640

URL: http://svn.apache.org/viewvc?view=rev&rev=518640
Log:
Pdf generation breakdown into several contracts just like the html generation.
If you have customized the common-fo.vt.xml for your project, then take the new one and adapt it to your custo.
Next :
- We need to find a way to store the common-fo.vt.xml into fo directory...
- We need to use <page>.body.xml instead of <page>.source.rewritten.xml in the content-main contract
- We should add configuration capabilities (such as change the numbering format in the toc)
- and much more...

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/hooksMatcher.xsl
      - copied unchanged from r517161, forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/strip-dispatcher-remains.xsl
      - copied unchanged from r517161, forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/strip-dispatcher-remains.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-abstract.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-authors.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-notice.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-title.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/layout-master-set.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-copyright.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-numbering.ft   (with props)
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-header.ft   (with props)
Removed:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/strip-dispatcher-remains.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content.ft
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/helper-fo-footer.ft
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/helper-fo-outline.ft
Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/common-fo.vt.xml

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap?view=diff&rev=518640&r1=518639&r2=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap Thu Mar 15 07:33:47 2007
@@ -164,7 +164,7 @@
           src="lm://transform.xml.xml-namespace-stripped" 
           />
         <map:transform 
-          src="resources/stylesheets/helper/strip-dispatcher-remains.xsl" 
+          src="lm://strip-dispatcher-remains-html.xsl" 
           />
         <map:serialize type="xhtml" />
       </map:match>
@@ -184,7 +184,11 @@
           <map:parameter name="validityFile" value="cocoon:/resolve.structurer.{1}" />
           <map:parameter name="request" value="{1}" />
           <map:parameter name="type" value="fo" />
+          <map:parameter name="hooksTransformer" value="lm://hooks-to-fo.xsl"/> 
         </map:transform>
+        <map:transform 
+          src="lm://strip-dispatcher-remains-fo.xsl" 
+          />
         <map:serialize  />
       </map:match>
       <map:match pattern="**.internal*">

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml?view=diff&rev=518640&r1=518639&r2=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml Thu Mar 15 07:33:47 2007
@@ -350,10 +350,19 @@
                     />
             </select>
         </match>
-        <match pattern="hooks-to-html.xsl">
-          <location 
-            src="{lm:dispatcher.home}/resources/stylesheets/hooksMatcher-html.xsl" 
-            />
+        <match pattern="hooks-to-**.xsl">
+            <select type="exists">
+                <location 
+                    src="{lm:dispatcher.home}/resources/stylesheets/{1}/hooksMatcher.xsl" 
+                    />
+             </select>
+        </match>
+        <match pattern="strip-dispatcher-remains-**.xsl">
+            <select type="exists">
+                <location 
+                    src="{lm:dispatcher.home}/resources/stylesheets/{1}/strip-dispatcher-remains.xsl" 
+                    />
+            </select>
         </match>
         <!-- contracts (e.g. html) that can be used in the project. -->
         <match pattern="ls.contracts.xsl">
@@ -429,6 +438,12 @@
         <match pattern="transform.xml.variable.helper">
           <location 
             src="{lm:dispatcher.home}/resources/stylesheets/helper/variable.helper.xsl" 
+            />
+        </match>
+        <!-- Id generation -->
+        <match pattern="generateId.xsl">
+          <location 
+            src="{lm:dispatcher.home}/resources/stylesheets/helper/generateId.xsl" 
             />
         </match>
     </locator>

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl Thu Mar 15 07:33:47 2007
@@ -0,0 +1,37 @@
+<?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.
+-->
+<xsl:stylesheet version="1.0" 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+  <!--This template will match the different combinations for hooks-->
+  <xsl:template match="hook">
+      <xsl:element name="fo:{@name}" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+        <xsl:apply-templates/>
+      </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="@*|*|text()|processing-instruction()|comment()">
+    <xsl:copy>
+      <xsl:apply-templates 
+        select="@*|*|text()|processing-instruction()|comment()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/hooksMatcher.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl Thu Mar 15 07:33:47 2007
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+  <xsl:key name="static-content" match="fo:static-content" use="@flow-name"/>
+
+  <xsl:template match="/">
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+	<xsl:copy-of select="/fo/layout-master-set/*"/>
+      </fo:layout-master-set>
+      <xsl:copy-of select="/fo/fox/outline/*"/>
+      <fo:page-sequence master-reference="book">
+        <xsl:for-each select="//fo:static-content[generate-id()=generate-id(key('static-content', @flow-name))]">
+          <xsl:sort select="@flow-name"/>
+	  <xsl:variable name="flow-name" select="@flow-name"/>
+          <fo:static-content flow-name="{@flow-name}">
+            <xsl:copy-of select="//fo:static-content[@flow-name=$flow-name]/*"/>
+          </fo:static-content>
+        </xsl:for-each>
+        <fo:flow flow-name="xsl-region-body">
+          <xsl:copy-of select="/fo/xsl-region-body/title/*"/>
+          <!-- FIXME : left was {$text-align} -->
+	  <fo:block text-align="left" padding-before="18pt" padding-after="18pt">
+            <xsl:copy-of select="/fo/xsl-region-body/body/*"/>
+          </fo:block>
+	  <fo:block id="term" /> 
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </xsl:template>
+
+
+</xsl:stylesheet>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/fo/strip-dispatcher-remains.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl?view=diff&rev=518640&r1=518639&r2=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl Thu Mar 15 07:33:47 2007
@@ -96,7 +96,9 @@
             <xsl:value-of select="title"/>
           </h2>
         </div>
-        <xsl:apply-templates select="*[not(self::title)]"/>
+        <div class="section">
+          <xsl:apply-templates select="*[not(self::title)]"/>
+        </div>
       </xsl:when>
       <!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
       <xsl:when test="$level=3 and $notoc='true'">

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl?view=diff&rev=518640&r1=518639&r2=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl Thu Mar 15 07:33:47 2007
@@ -33,6 +33,7 @@
         <title>*No* title found</title>
       </xsl:otherwise>
     </xsl:choose>
-
+    <!-- FIXME - Need to manage the subtitle -->
+    <!--xsl:copy-of select="header/subtitle"/-->
   </xsl:template>
 </xsl:stylesheet>

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-abstract.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-abstract.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-abstract.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-abstract.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,53 @@
+<?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="content-abstract">
+  <description>
+    <p>content-abstract will output the abstract of the content.</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="content-abstract" dataURI="cocoon://#{$getRequest}.abstract.xml"/>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-abstract" 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/xsl-region-body/title">
+            <fo:block font-size="12pt" text-align="center"
+              space-before="20pt" space-after="25pt" width="7.5in"
+              font-family="serif" font-style="italic">
+              <!-- FIXME - Don't know how to manage the insertPageBreaks... -->
+              <!--xsl:call-template name="insertPageBreaks"/-->
+              <xsl:apply-templates select="//div[@class='abstract']"/>
+            </fo:block>
+          </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/content-abstract.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-authors.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-authors.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-authors.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-authors.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,57 @@
+<?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="content-authors">
+  <description>
+    <p>content-authors will output the authors of the content.</p>
+  </description>
+ <usage><![CDATA[<forrest:contract name="content-authors" 
+          dataURI="cocoon://#{$getRequest}.authors.xml"/>]]></usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-authors" 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/xsl-region-body/title">
+            <xsl:if test="//div[@class='author']">
+              <fo:block space-before="20pt" font-weight="bold" font-size="9pt">
+                <!-- FIXME - Don't know how to manage the insertPageBreaks... -->
+                <!--xsl:call-template name="insertPageBreaks"/-->
+                <!-- FIXME - insert i18n stuff here --> by
+                <xsl:for-each select="//div[@class='author']">
+                  <xsl:value-of select="./div[@class='name']/text()"/>
+                  <xsl:if test="not(position() = last())">,
+                  </xsl:if>
+                </xsl:for-each>
+              </fo:block>
+            </xsl:if>
+          </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/content-authors.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,57 @@
+<?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="content-main-outline">
+<description>
+    content-main-outline will output the main content outline of the document.
+  </description>
+  <usage><![CDATA[<forrest:contract name="content-main-outline" dataURI="cocoon://#{$getRequest}.toc.xml"/>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-main-outline" inputFormat="xsl">
+    <xsl:stylesheet
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+      xmlns:fo="http://www.w3.org/1999/XSL/Format"
+      xmlns:fox="http://xml.apache.org/fop/extensions"
+      version="1.0">
+
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/fo/fox/outline">
+            <xsl:apply-templates select="/tocitems"/>
+          </forrest:part>
+        </forrest:content>  
+      </xsl:template>
+
+      <xsl:template match="tocitem">
+        <fox:outline internal-destination="{@href}">
+          <fox:label>
+            <xsl:number format="1.1.1.1.1.1.1" count="tocitem" level="multiple"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="@title"/>
+          </fox:label>
+          <xsl:apply-templates select="tocitem"/>
+        </fox:outline>
+      </xsl:template>
+
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main-outline.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,679 @@
+<?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="content-main">
+<description>
+    content-main will output the main content of the document.
+  </description>
+  <usage><![CDATA[<forrest:contract name="content-main" dataURI="cocoon://#{$getRequest}.source.rewritten.xml">
+       <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 text-align="left" background-color="#ffffff"/>
+        
+        <!-- Heading types can be clean|underlined|boxed  -->
+        <headings type="boxed" color="#4a6d8c"/>
+
+        <!--
+        Print the URL text next to all links going outside the file
+        -->
+        <show-external-urls>false</show-external-urls>
+
+        <colors>
+          <color name="code" value="#CFDCED"/>
+          <color name="highlight" value="#ffff00"/>
+          <color name="fixme" value="#cc6600"/>
+          <color name="note" value="#006699"/>
+          <color name="warning" value="#990000"/>
+          <color name="table" value="#7099C5"/>
+          <color name="table-cell" value="#f0f0ff"/>
+          <color name="body" value="#ffffff" link="#0F3660"
+            vlink="#009999" hlink="#000066"/>
+        </colors>
+      </forrest:property>
+    </forrest:contract>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-main" 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="config"/>
+      <!-- left, justify, right -->
+      <xsl:variable name="text-align"
+        select="string($config/page/@text-align)"/>
+      
+      <!-- print URL of external links -->
+      <xsl:variable name="show-external-urls"
+        select="$config/show-external-urls"/>
+      
+      <xsl:param name="numbersections" select="'true'"/>
+
+      <!-- page breaks after TOC and each page if an aggregate document -->
+      <xsl:variable name="page-break-top-sections"
+        select="'true'"/>
+
+      <!-- Section depth at which we stop numbering and just indent -->
+      <xsl:param name="numbering-max-depth" select="'3'"/>
+      <xsl:param name="imagesdir" select="."/>
+      <xsl:param name="xmlbasedir"/>
+      <xsl:include
+        href="cocoon://prepare.contract.fo.helper-fo-outline"/>
+      <xsl:include
+        href="cocoon://prepare.contract.fo.helper-fo-footer"/>
+
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/fo/xsl-region-body/body">
+            <fo:block text-align="{$text-align}" padding-before="18pt" padding-after="18pt">
+              <xsl:apply-templates select="/document/body"/>
+            </fo:block>
+          </forrest:part>
+        </forrest:content>
+        
+      </xsl:template>
+
+      <xsl:template match="anchor">
+        <fo:block id="{@id}"/>
+        <xsl:apply-templates/>
+      </xsl:template>
+      
+      <xsl:template match="section">
+        
+        <xsl:param name="level">0</xsl:param>
+        
+        <xsl:variable name="size">
+          <!-- 14pt for level 1 12pt for level 2 -->
+          <xsl:value-of select="14-number($level)"/>
+        </xsl:variable>
+        
+        <xsl:variable name="background-color"
+          select="$config/page/@background-color"/>
+        <xsl:variable name="heading-color"
+          select="$config/headings/@color"/>
+        <xsl:variable name="heading-type"
+          select="$config/headings/@type"/>
+        
+        <fo:block font-family="serif" font-size="{$size}pt"
+          font-weight="bold" space-before="12pt"
+          space-after="4pt" id="#{@id}">
+          
+          <xsl:call-template name="insertPageBreaks"/>
+          
+          <xsl:if test="$heading-type = 'boxed'">
+            <xsl:attribute name="background-color">
+              <xsl:value-of select="$heading-color"/>
+            </xsl:attribute>
+          </xsl:if>
+
+          <xsl:if
+            test="$numbersections = 'true' and number($level) &lt; $numbering-max-depth+1">
+            <xsl:number format="1.1.1.1.1.1.1" count="section"
+              level="multiple"/>
+            <xsl:text>. </xsl:text>
+          </xsl:if>
+
+          <!-- For sections 4  or more nestings deep, indent instead of number -->
+          <xsl:if
+            test="number($level) &gt; $numbering-max-depth+1">
+            <xsl:attribute name="start-indent">
+              <xsl:value-of select="4+number($level)"/>
+              <xsl:text>pt</xsl:text>
+            </xsl:attribute>
+          </xsl:if>
+          
+          <xsl:value-of select="title"/>
+        </fo:block>
+        <xsl:if test="$heading-type = 'underlined'">
+          <!-- The non-breaking space in this block is required, otherwise
+          the block won't be rendered at all. -->
+          <fo:block font-family="serif"
+            font-size="{10 div (number($level) +1 )}pt"
+            background-color="{$heading-color}">&#160;
+          </fo:block>
+        </xsl:if>
+        <fo:block background-color="{$background-color}">
+          <xsl:apply-templates>
+            <xsl:with-param name="level"
+              select="number($level)+1"/>
+          </xsl:apply-templates>
+        </fo:block>
+      </xsl:template>
+
+      <!-- Already taken into account with sections -->
+      <xsl:template match="title"/>
+
+      <xsl:template match="p">
+        <xsl:choose>
+          <xsl:when
+            test="ancestor::li and not(preceding-sibling::*)">
+            <fo:block space-after="4pt" font-family="serif">
+              <xsl:call-template name="insertPageBreaks"/>
+              <xsl:apply-templates/>
+            </fo:block>
+          </xsl:when>
+          <xsl:otherwise>
+            <fo:block space-before="4pt" space-after="4pt"
+              font-family="serif">
+              <xsl:call-template name="insertPageBreaks"/>
+              <xsl:apply-templates/>
+            </fo:block>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:template>
+      
+      <xsl:template match="source">
+        <xsl:variable name="color"
+          select="$config/colors/color[@name='code']/@value"/>
+        <fo:block font-family="monospace" font-size="10pt"
+          background-color="{$color}"
+          white-space-collapse="false"
+          linefeed-treatment="preserve"
+          white-space-treatment="preserve" wrap-option="wrap"
+          text-align="start">
+          <xsl:call-template name="insertPageBreaks"/>
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template match="ol|ul">
+        <fo:list-block
+          provisional-distance-between-starts="18pt"
+          provisional-label-separation="3pt"
+          text-align="start">
+          <xsl:apply-templates/>
+        </fo:list-block>
+      </xsl:template>
+      
+      <xsl:template match="ol/li">
+        <fo:list-item>
+          <xsl:if test="not(following-sibling::li[1])">
+            <xsl:attribute name="space-after">
+              6pt"</xsl:attribute>
+          </xsl:if>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block>
+              <xsl:number format="1."/>
+            </fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <fo:block font-family="serif">
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+      </xsl:template>
+      
+      <!-- Emulate browser handling of these invalid combinations that our DTD
+      unfortunately allows -->
+      <xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
+        <fo:list-item>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block></fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <fo:block font-family="serif">
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+      </xsl:template>
+      
+      <xsl:template match="ul/li">
+        <fo:list-item>
+          <xsl:if test="not(following-sibling::li[1])">
+            <xsl:attribute name="space-after">
+              6pt</xsl:attribute>
+          </xsl:if>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block>&#x2022;
+            </fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <fo:block font-family="serif">
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+      </xsl:template>
+      
+      <xsl:template match="dl">
+        <fo:list-block
+          provisional-distance-between-starts="18pt"
+          provisional-label-separation="3pt"
+          text-align="start">
+          <xsl:apply-templates/>
+        </fo:list-block>
+      </xsl:template>
+      
+      <xsl:template match="dt">
+        <fo:list-item>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block></fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <fo:block font-weight="bold">
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+      </xsl:template>
+      
+      <xsl:template match="dd">
+        <fo:list-item>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block></fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <fo:block>
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+      </xsl:template>
+      
+      <xsl:template match="strong">
+        <fo:inline font-weight="bold">
+          <xsl:apply-templates/>
+        </fo:inline>
+      </xsl:template>
+      
+      <xsl:template match="em">
+        <fo:inline font-style="italic">
+          <xsl:apply-templates/>
+        </fo:inline>
+      </xsl:template>
+      
+      <xsl:template match="code">
+        <fo:inline font-family="monospace">
+          <xsl:apply-templates/>
+        </fo:inline>
+      </xsl:template>
+      
+      <xsl:template match="warning">
+        <xsl:variable name="color"
+          select="$config/colors/color[@name='warning']/@value"/>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-weight="bold" font-size="10pt"
+          font-family="serif" space-before="10pt"
+          border-before-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}" background-color="{$color}"
+          color="#ffffff">
+          <xsl:call-template name="insertPageBreaks"/>
+          <xsl:choose>
+            <xsl:when test="@label">
+              <xsl:value-of select="@label"/>
+            </xsl:when>
+            <xsl:otherwise>Warning: </xsl:otherwise>
+          </xsl:choose>
+          <xsl:value-of select="title"/>
+        </fo:block>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-family="serif" font-size="8pt"
+          border-after-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}" background-color="#fff0f0"
+          padding-start="3pt" padding-end="3pt"
+          padding-before="3pt" padding-after="3pt"
+          space-after="10pt">
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template match="note">
+        <xsl:variable name="color"
+          select="$config/colors/color[@name='note']/@value"/>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-weight="bold" font-size="10pt" color="#ffffff"
+          font-family="serif" space-before="10pt"
+          border-before-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}"
+          background-color="{$color}">
+          <xsl:call-template name="insertPageBreaks"/>
+          <xsl:choose>
+            <xsl:when test="@label">
+              <xsl:value-of select="@label"/>
+            </xsl:when>
+            <!-- insert i18n stuff here -->
+            <xsl:otherwise>Note: </xsl:otherwise>
+          </xsl:choose>
+          <xsl:value-of select="title"/>
+        </fo:block>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-family="serif" font-size="8pt"
+          space-after="10pt" border-after-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}" background-color="#F0F0FF"
+          padding-start="3pt" padding-end="3pt"
+          padding-before="3pt" padding-after="3pt">
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template match="fixme">
+        <xsl:variable name="color"
+          select="$config/colors/color[@name='fixme']/@value"/>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-weight="bold" font-size="10pt" color="#FFFFFF"
+          font-family="serif" space-before="10pt"
+          border-before-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}"
+          background-color="{$color}">
+          <xsl:call-template name="insertPageBreaks"/>
+          <!-- insert i18n stuff here --> FIXME (
+          <xsl:value-of select="@author"/>):
+          <xsl:value-of select="title"/> </fo:block>
+        <fo:block margin-left="0.25in" margin-right="0.25in"
+          font-family="serif" font-size="8pt"
+          space-after="10pt" border-after-style="solid"
+          border-start-style="solid" border-end-style="solid"
+          border-color="{$color}" background-color="#FFF0F0"
+          padding-start="3pt" padding-end="3pt"
+          padding-before="3pt" padding-after="3pt">
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template match="link|fork|jump">
+        <xsl:variable name="color"
+          select="$config/colors/color[@name = 'body']/@link"/>
+        <xsl:choose>
+          <xsl:when test="starts-with(@href, '#')">
+            <fo:basic-link color="{$color}"
+              text-decoration="underline"
+              internal-destination="{substring(@href,2)}">
+              <xsl:apply-templates/>
+            </fo:basic-link>
+          </xsl:when>
+          <xsl:otherwise>
+            <fo:basic-link color="{$color}"
+              text-decoration="underline"
+              external-destination="{@href}">
+              <xsl:apply-templates/>
+            </fo:basic-link>
+            <xsl:if
+              test="$show-external-urls = 'true' and @href != string(.)">
+              (
+              <xsl:value-of select="@href"/>) </xsl:if>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:template>
+      
+      <xsl:template match="figure|img">
+        <fo:block text-align="center">
+          <xsl:call-template name="insertPageBreaks"/>
+          <xsl:if test="normalize-space(@id)!=''">
+            <xsl:attribute name="id">
+              <xsl:value-of select="@id"/>
+            </xsl:attribute>
+          </xsl:if>
+          
+          <!-- Make relative paths absolute -->
+          <xsl:variable name="imgpath">
+            <xsl:choose>
+              <!-- resources image dir -->
+              <xsl:when
+                test="starts-with(string(@src),'images/')">
+                <xsl:value-of
+                  select="concat($imagesdir,substring-after(@src,'images'))"/>
+              </xsl:when>
+              <!-- already absolute -->
+              <xsl:when
+                test="contains(string(@src),':') or starts-with(string(@src),'/')">
+                <xsl:value-of select="@src"/>
+              </xsl:when>
+              <!-- relative to document -->
+              <xsl:otherwise>
+                <xsl:value-of
+                  select="concat($xmlbasedir,@src)"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:variable>
+          <fo:external-graphic src="{$imgpath}">
+            <xsl:if test="@height">
+              <xsl:attribute name="height">
+                <xsl:value-of select="@height"/>
+              </xsl:attribute>
+            </xsl:if>
+            <xsl:if test="@width">
+              <xsl:attribute name="width">
+                <xsl:value-of select="@width"/>
+              </xsl:attribute>
+            </xsl:if>
+          </fo:external-graphic>
+          <!-- alt text -->
+          <xsl:if test="$config/show-image-alt-text='true'">
+            <xsl:if test="normalize-space(@alt)!=''">
+              <fo:block>
+                <xsl:value-of select="@alt"/>
+              </fo:block>
+            </xsl:if>
+          </xsl:if>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template match="table">
+        <!-- FIXME: Apache FOP must have column widths specified at present,
+        this section can be removed when this limitation is removed from Fop.
+        Unfortunately, this means that each column is a fixed width,
+        but at least the table displays! -->
+        
+        <xsl:variable name="max-number-columns-td">
+          <xsl:for-each select="tr">
+            <xsl:sort select="count(td|th)" data-type="number"
+              order="descending"/>
+            <xsl:if test="position() = 1">
+              <xsl:value-of select="count(td|th)"/>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:variable>
+        
+        <xsl:variable name="max-number-columns-colspan">
+          <xsl:for-each select="tr">
+            <xsl:sort select="count(td|th)" data-type="number"
+              order="descending"/>
+            <xsl:if test="position() = 1">
+              <xsl:value-of select="sum(td/@colspan|th/@colspan)"/>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:variable>
+        
+        <xsl:variable name="max-number-columns">
+          <xsl:choose>
+            <xsl:when test="$max-number-columns-colspan&gt;$max-number-columns-td">
+              <xsl:value-of select="$max-number-columns-colspan"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$max-number-columns-td"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        
+        <xsl:variable name="column-width">
+          <xsl:value-of
+            select="6.25 div number($max-number-columns)"/>
+          in </xsl:variable>
+        
+        <fo:table>
+          
+          <fo:table-column>
+            <xsl:attribute name="column-width">
+              <xsl:value-of select="$column-width"/>
+            </xsl:attribute>
+            
+            <xsl:attribute name="number-columns-repeated">
+              <xsl:value-of
+                select="number($max-number-columns)"/>
+            </xsl:attribute>
+          </fo:table-column>
+          
+          <!-- End of hack for Fop support (if removing this hack, remember
+          you need the <fo:table> element) -->
+          
+          <fo:table-body font-size="10pt"
+            font-family="sans-serif">
+            <xsl:apply-templates select="tr"/>
+          </fo:table-body>
+        </fo:table>
+        
+        <!-- FIXME: Apache Fop does not support the caption element yet.
+        
+        
+        This hack will display the table caption accordingly. -->
+        <xsl:if test="caption">
+          <fo:block text-align="center" font-weight="bold">
+            <!-- insert i18n stuff here --> Table
+            <xsl:text>
+            </xsl:text>
+            <xsl:number count="table" level="multiple"/>
+            <xsl:text>: </xsl:text>
+            <xsl:value-of select="caption"/> </fo:block>
+        </xsl:if>
+      </xsl:template>
+      
+      <xsl:template match="tr">
+        <fo:table-row>
+          <xsl:apply-templates/>
+        </fo:table-row>
+      </xsl:template>
+      
+      <xsl:template match="th">
+        <xsl:variable name="border-color"
+          select="$config/colors/color[@name = 'table']/@value"/>
+        <xsl:variable name="background-color"
+          select="$border-color"/>
+        <fo:table-cell padding-before="4pt"
+          padding-after="4pt" padding-start="4pt"
+          padding-end="4pt" color="#FFFFFF"
+          background-color="{$background-color}"
+          border="1pt solid {$border-color}">
+          <xsl:attribute name="number-columns-spanned">
+            <xsl:value-of select="@colspan"/>
+          </xsl:attribute>
+          <xsl:attribute name="number-rows-spanned">
+            <xsl:value-of select="@rowspan"/>
+          </xsl:attribute>
+          <fo:block text-align="center">
+            <xsl:apply-templates/>
+          </fo:block>
+        </fo:table-cell>
+      </xsl:template>
+      
+      <xsl:template match="td">
+        <xsl:variable name="border-color"
+          select="$config/colors/color[@name = 'table']/@value"/>
+        <xsl:variable name="background-color"
+          select="$config/colors/color[@name = 'table-cell']/@value"/>
+        <fo:table-cell padding-before="4pt"
+          padding-after="4pt" padding-start="4pt"
+          padding-end="4pt"
+          background-color="{$background-color}"
+          border="1pt solid {$border-color}">
+          <xsl:attribute name="number-columns-spanned">
+            <xsl:value-of select="@colspan"/>
+          </xsl:attribute>
+          <xsl:attribute name="number-rows-spanned">
+            <xsl:value-of select="@rowspan"/>
+          </xsl:attribute>
+          <fo:block>
+            <xsl:apply-templates/>
+          </fo:block>
+        </fo:table-cell>
+      </xsl:template>
+      
+      <xsl:template match="br">
+        <fo:block></fo:block>
+      </xsl:template>
+      
+      <xsl:template match="legal">
+        <fo:inline font-size="8pt">
+          <xsl:apply-templates/>
+        </fo:inline>
+      </xsl:template>
+
+      <!-- ====================================================================== -->
+      <!-- Local Extensions section -->
+      
+      
+      <!-- ====================================================================== -->
+      
+      <xsl:template match="citation">
+        <fo:inline> [
+          <xsl:value-of select="@def"/>] </fo:inline>
+      </xsl:template>
+      
+      <xsl:template match="p[@class='quote']">
+        <fo:block start-indent="1em" space-before="4pt"
+          space-after="4pt" background-color="#f0f0f0"
+          font-family="monospace">
+          <xsl:call-template name="insertPageBreaks"/>
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:template>
+      
+      <xsl:template name="insertPageBreaks">
+        
+        
+        <!-- if marked as a 'pageBreakBefore', and we're breaking on pages, and were not the first node -->
+        <xsl:if
+          test="contains(@class, 'pageBreakBefore') and preceding-sibling::node()">
+          <xsl:attribute name="break-before">
+            page</xsl:attribute>
+        </xsl:if>
+        
+        
+        <!-- if marked as a 'pageBreakAfter', and we're breaking on pages, and were not the last node -->
+        <xsl:if
+          test="contains(@class, 'pageBreakAfter') and following-sibling::node()">
+          <xsl:attribute name="break-after">
+            page</xsl:attribute>
+        </xsl:if>
+      </xsl:template>
+
+      <!-- ====================================================================== -->
+      
+      
+      <!-- Temporary section - subject to change on short notice  -->
+      
+      
+      <!-- ====================================================================== -->
+      
+      <xsl:template match="//style">
+        <!-- HACK: The OpenOffice.org input plugin currently produces
+        intermediate documents that contain a style element, invalid per
+        the Forrest Document DTD. This style element must be ignored
+        here. To find out why this is done this way, read the comments
+        attached to issue FOR-433. -->
+      </xsl:template>
+      
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-main.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-notice.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-notice.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-notice.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-notice.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,55 @@
+<?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="content-notice">
+  <description>
+    <p>content-notice will output the notice of the content.</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="content-notice" dataURI="cocoon://#{$getRequest}.notice.xml"/>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-notice" 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/xsl-region-body/title">
+            <xsl:if test="//div[class='notice']/*">
+              <fo:block font-size="10pt" text-align="left" space-before="20pt" width="7.5in"
+                font-family="serif" border-top="0.25pt solid" border-bottom="0.25pt solid" padding-before="6pt"
+                padding-after="6pt">
+                <!-- FIXME - Don't know how to manage the insertPageBreaks... -->
+                <!--xsl:call-template name="insertPageBreaks"/-->
+                <!-- FIXME - insert i18n stuff here --> NOTICE:
+                <xsl:apply-templates/>
+              </fo:block>
+            </xsl:if>
+          </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/content-notice.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-title.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-title.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-title.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-title.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,61 @@
+<?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="content-title">
+  <description>
+    <p>content-title - - Template will output the title of the pdf file.</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="content-title"
+      dataURI="cocoon://#{$getRequest}.title.xml"/>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-title" 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:title>
+              <xsl:value-of select="title"/>
+            </fo:title>
+          </forrest:part>
+          <forrest:part xpath="/fo/xsl-region-body/title">
+            <fo:block padding-before="24pt" padding-after="24pt" font-size="24pt" font-weight="bold" id="{generate-id()}">
+              <xsl:value-of select="title"/>
+            </fo:block>
+            <!-- FIXME - Need to manage Subtitle -->       
+            <!--
+            <fo:block font-weight="bold" font-size="16pt">
+              <xsl:call-template name="insertPageBreaks"/>
+              <xsl:apply-templates/>
+            </fo:block>
+            -->
+          </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/content-title.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,97 @@
+<?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="content-toc">
+  <description>
+    <p>content-toc will output the table of content.</p>
+    <p>@toc-max-depth - Specifies how many "section" levels need to be included in the
+        generated Table of Contents (TOC).</p>
+  </description>
+  <usage>
+    <![CDATA[<forrest:contract name="content-toc" dataURI="cocoon://#{$getRequest}.toc.xml">
+      <forrest:property name="max-depth">2</forrest:property>
+      <forrest:property name="page-break-after">[true|false]</forrest:property>
+    </xsl:forrest:contract>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="content-toc" 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="max-depth" select="2"/>
+      <xsl:param name="page-break-after" select="'true'"/>
+
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/fo/xsl-region-body/title">
+            <fo:block font-family="serif" font-size="14pt"
+              font-weight="bold" space-after="5pt"
+              space-before="5pt" text-align="justify"
+              width="7.5in">
+              <!-- xsl:call-template name="insertPageBreaks"/ -->
+              <!-- FIXME - insert i18n stuff here -->
+              <xsl:text>Table of contents</xsl:text>
+            </fo:block>
+            <fo:block font-family="sans" font-size="12pt"
+              space-after="5pt" space-before="0pt"
+              text-align="justify" width="7.5in">
+              <xsl:if test="$page-break-after">
+                <xsl:attribute name="break-after">page</xsl:attribute>
+              </xsl:if>
+              <xsl:apply-templates select="/tocitems/tocitem"/>
+            </fo:block>
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+
+      <xsl:template match="tocitem">
+        <!-- FIXME: see bug FOR-640 -->
+        <xsl:param name="depth" select="'1'"/>
+        <fo:block space-before="5pt" text-align-last="justify"
+          start-indent=".5em" text-indent=".5em">
+          <fo:inline>
+            <fo:basic-link internal-destination="{@href}">
+              <xsl:value-of
+                select="substring('&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;', 0, 2 * $depth - 1)"/>
+              <fo:inline font-size="10pt">
+                <xsl:number count="tocitem"
+                  format="1.1.1.1.1.1.1" level="multiple"/>
+              </fo:inline>
+              <xsl:text>
+              </xsl:text>
+              <xsl:value-of select="@title"/>
+              <fo:leader leader-pattern="dots"/>
+              <fo:page-number-citation ref-id="{@href}"/>
+            </fo:basic-link>
+          </fo:inline>
+          <xsl:if test="$max-depth > $depth">
+            <xsl:apply-templates select="tocitem">
+              <xsl:with-param name="depth"
+                select="$depth + 1"/>
+            </xsl:apply-templates>
+          </xsl:if>
+        </fo:block>
+      </xsl:template>
+
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/content-toc.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/layout-master-set.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/layout-master-set.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/layout-master-set.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/layout-master-set.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,318 @@
+<?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="layout-master-set">
+  <description>
+    <p>layout master set generate the ...</p>
+  </description>
+  <usage>
+    <![CDATA[<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"/>
+        
+        <!--
+        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>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="layout-master-set" 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="config"/>
+      
+      <!-- The page size to be used -->
+      <xsl:variable name="pagesize"
+        select="string($config/page/@size)"/>
+      
+      <!-- The page orientation ("portrait" or "landscape") -->
+      <xsl:variable name="pageorientation"
+        select="string($config/page/@orientation)"/>
+      
+      <!-- Double-sided printing toggle -->
+      <xsl:variable name="doublesided"
+        select="string($config/margins/@double-sided)"/>
+      
+      <!-- The top page margin -->
+      <xsl:variable name="topmargin"
+        select="string($config/margins/top)"/>
+      
+      <!-- The bottom page margin -->
+      <xsl:variable name="bottommargin"
+        select="string($config/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/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/margins/outer)"/>
+      
+      <!-- Determine page height for various page sizes (US Letter portrait
+      is the default) -->
+      <!-- FIXME: JJP:would this be better of a file? -->
+      <xsl:variable name="pageheight">
+        <xsl:choose>
+          <xsl:when test="$pageorientation = 'landscape'">
+            <xsl:choose>
+              <xsl:when test="$pagesize = 'a0'">
+                841mm</xsl:when>
+              <xsl:when test="$pagesize = 'a1'">
+                594mm</xsl:when>
+              <xsl:when test="$pagesize = 'a2'">
+                420mm</xsl:when>
+              <xsl:when test="$pagesize = 'a3'">
+                297mm</xsl:when>
+              <xsl:when test="$pagesize = 'a4'">
+                210mm</xsl:when>
+              <xsl:when test="$pagesize = 'a5'">
+                148mm</xsl:when>
+              <xsl:when test="$pagesize = 'executive'">
+                7.25in</xsl:when>
+              <xsl:when test="$pagesize = 'folio'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'ledger'">
+                11in</xsl:when>
+              <xsl:when test="$pagesize = 'legal'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'letter'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'quarto'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'tabloid'">
+                11in</xsl:when>
+              <xsl:otherwise>8.5in</xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:choose>
+              <xsl:when test="$pagesize = 'a0'">
+                1189mm</xsl:when>
+              <xsl:when test="$pagesize = 'a1'">
+                841mm</xsl:when>
+              <xsl:when test="$pagesize = 'a2'">
+                594mm</xsl:when>
+              <xsl:when test="$pagesize = 'a3'">
+                420mm</xsl:when>
+              <xsl:when test="$pagesize = 'a4'">
+                297mm</xsl:when>
+              <xsl:when test="$pagesize = 'a5'">
+                210mm</xsl:when>
+              <xsl:when test="$pagesize = 'executive'">
+                10.5in</xsl:when>
+              <xsl:when test="$pagesize = 'folio'">
+                13in</xsl:when>
+              <xsl:when test="$pagesize = 'ledger'">
+                17in</xsl:when>
+              <xsl:when test="$pagesize = 'legal'">
+                14in</xsl:when>
+              <xsl:when test="$pagesize = 'quarto'">
+                10.83in</xsl:when>
+              <xsl:when test="$pagesize = 'tabloid'">
+                17in</xsl:when>
+              <xsl:otherwise>11in</xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      
+      <!-- Determine page width for various page sizes (US Letter portrait
+      is the default) -->
+      <xsl:variable name="pagewidth">
+        <xsl:choose>
+          <xsl:when test="$pageorientation = 'landscape'">
+            <xsl:choose>
+              <xsl:when test="$pagesize = 'a0'">
+                1189mm</xsl:when>
+              <xsl:when test="$pagesize = 'a1'">
+                841mm</xsl:when>
+              <xsl:when test="$pagesize = 'a2'">
+                594mm</xsl:when>
+              <xsl:when test="$pagesize = 'a3'">
+                420mm</xsl:when>
+              <xsl:when test="$pagesize = 'a4'">
+                297mm</xsl:when>
+              <xsl:when test="$pagesize = 'a5'">
+                210mm</xsl:when>
+              <xsl:when test="$pagesize = 'executive'">
+                10.5in</xsl:when>
+              <xsl:when test="$pagesize = 'folio'">
+                13in</xsl:when>
+              <xsl:when test="$pagesize = 'ledger'">
+                17in</xsl:when>
+              <xsl:when test="$pagesize = 'legal'">
+                14in</xsl:when>
+              <xsl:when test="$pagesize = 'quarto'">
+                10.83in</xsl:when>
+              <xsl:when test="$pagesize = 'tabloid'">
+                17in</xsl:when>
+              <xsl:otherwise>11in</xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:choose>
+              <xsl:when test="$pagesize = 'a0'">
+                841mm</xsl:when>
+              <xsl:when test="$pagesize = 'a1'">
+                594mm</xsl:when>
+              <xsl:when test="$pagesize = 'a2'">
+                420mm</xsl:when>
+              <xsl:when test="$pagesize = 'a3'">
+                297mm</xsl:when>
+              <xsl:when test="$pagesize = 'a4'">
+                210mm</xsl:when>
+              <xsl:when test="$pagesize = 'a5'">
+                148mm</xsl:when>
+              <xsl:when test="$pagesize = 'executive'">
+                7.25in</xsl:when>
+              <xsl:when test="$pagesize = 'folio'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'ledger'">
+                11in</xsl:when>
+              <xsl:when test="$pagesize = 'legal'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'letter'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'quarto'">
+                8.5in</xsl:when>
+              <xsl:when test="$pagesize = 'tabloid'">
+                11in</xsl:when>
+              <xsl:otherwise>8.5in</xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/fo/layout-master-set">
+            <fo:simple-page-master
+              master-name="first-page"
+              page-height="{$pageheight}"
+              page-width="{$pagewidth}"
+              margin-top="{$topmargin}"
+              margin-bottom="{$bottommargin}"
+              margin-left="{$innermargin}"
+              margin-right="{$outermargin}">
+              <fo:region-body margin-top="0.5in"
+                margin-bottom=".5in"/>
+              <fo:region-after region-name="first-footer"
+                extent=".5in" display-align="before"/>
+            </fo:simple-page-master>
+                
+            <fo:simple-page-master
+              master-name="even-page"
+              page-height="{$pageheight}"
+              page-width="{$pagewidth}"
+              margin-top="{$topmargin}"
+              margin-bottom="{$bottommargin}">
+              <xsl:choose>
+                <xsl:when test="$doublesided = 'true'">
+                  <xsl:attribute name="margin-left">
+                    <xsl:value-of select="$outermargin"/>
+                  </xsl:attribute>
+                  <xsl:attribute name="margin-right">
+                    <xsl:value-of select="$innermargin"/>
+                  </xsl:attribute>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:attribute name="margin-left">
+                    <xsl:value-of select="$innermargin"/>
+                  </xsl:attribute>
+                  <xsl:attribute name="margin-right">
+                    <xsl:value-of select="$outermargin"/>
+                  </xsl:attribute>
+                </xsl:otherwise>
+              </xsl:choose>
+              <fo:region-before region-name="even-header"
+                extent="0.5in"
+                border-bottom="0.5pt solid"/>
+              <fo:region-body margin-top="0.5in"
+                margin-bottom=".5in"/>
+              <fo:region-after region-name="even-footer"
+                extent=".5in" display-align="before"/>
+            </fo:simple-page-master>
+            
+            <fo:simple-page-master master-name="odd-page"
+              page-height="{$pageheight}"
+              page-width="{$pagewidth}"
+              margin-top="{$topmargin}"
+              margin-bottom="{$bottommargin}"
+              margin-left="{$innermargin}"
+              margin-right="{$outermargin}">
+              <fo:region-before region-name="odd-header"
+                extent="0.5in"
+                border-bottom="0.5pt solid"/>
+              <fo:region-body margin-top="0.5in"
+                margin-bottom=".5in"/>
+              <fo:region-after region-name="odd-footer"
+                extent=".5in" display-align="before"/>
+            </fo:simple-page-master>
+                
+                <fo:page-sequence-master master-name="book">
+                  <fo:repeatable-page-master-alternatives>
+                    <fo:conditional-page-master-reference
+                      page-position="first"
+                      master-reference="first-page"/>
+                    <fo:conditional-page-master-reference
+                      odd-or-even="odd"
+                      master-reference="odd-page"/>
+                    <fo:conditional-page-master-reference
+                      odd-or-even="even"
+                      master-reference="even-page"/>
+                  </fo:repeatable-page-master-alternatives>
+                </fo:page-sequence-master>
+              
+          </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/layout-master-set.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-copyright.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-copyright.ft?view=auto&rev=518640
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-copyright.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/page-footer-copyright.ft Thu Mar 15 07:33:47 2007
@@ -0,0 +1,160 @@
+<?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-copyright">
+  <description>
+    <p>page-footer-copyright display the footer of the pdf..</p>
+  </description>
+        <!-- The following are used to construct a copyright statement -->
+  <usage>
+    <![CDATA[<forrest:contract name="page-footer-copyright">
+      <forrest:property name="copyright">
+        <year [inception="[true|false]"]>2005</year>
+        <vendor>The Acme Software Foundation.</vendor>
+        [<url>http://myproj.mygroup.org/</url>]
+        [<msg>All rights reserved.</msg>]
+        [<property>copyright, patent, trademark...</property>]
+        [<symbol>&#169;, &#174;, &#153;...</symbol>]
+      </forrest:property>
+    </forrest:contract>]]>
+  </usage>
+  <forrest:template
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="page-footer-copyright" inputFormat="xsl">
+    <xsl:stylesheet
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+      xmlns:fo="http://www.w3.org/1999/XSL/Format"
+      xmlns:java="http://xml.apache.org/xslt/java"
+      exclude-result-prefixes="java"
+      version="1.0">
+      <xsl:param name="copyright"/>
+
+      <xsl:variable name="symbol">
+        <xsl:choose >
+          <xsl:when test = "$copyright/symbol">
+            <xsl:value-of select="$copyright/symbol"/>
+          </xsl:when>
+          <xsl:otherwise>&#169;</xsl:otherwise>
+        </xsl:choose> 
+      </xsl:variable>
+      <xsl:variable name="msg">
+        <xsl:choose >
+          <xsl:when test = "$copyright/msg">
+            <xsl:value-of select="$copyright/msg"/>
+          </xsl:when>
+          <xsl:otherwise>All rights reserved.</xsl:otherwise>
+        </xsl:choose> 
+      </xsl:variable>
+      <xsl:variable name="property">
+        <xsl:choose >
+          <xsl:when test = "$copyright/property">
+            <xsl:value-of select="$copyright/property"/>
+          </xsl:when>
+          <xsl:otherwise>Copyright</xsl:otherwise>
+        </xsl:choose> 
+      </xsl:variable>
+ 
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/fo/static-content">
+
+            <fo:static-content flow-name="first-footer">
+              <xsl:call-template name="info"/>
+            </fo:static-content>
+
+            <fo:static-content flow-name="even-footer">
+              <xsl:call-template name="info"/>
+            </fo:static-content>
+
+            <fo:static-content flow-name="odd-footer">
+              <xsl:call-template name="info"/>
+            </fo:static-content>
+
+          </forrest:part>
+        </forrest:content>
+        
+      </xsl:template>
+
+      <xsl:template name="info">
+        <xsl:variable name="text">
+          <xsl:value-of select="$property"/>&#160;
+          <xsl:value-of select="$symbol"/>&#160;
+          <xsl:value-of select="$copyright/year"/><xsl:call-template name="current-year"/>&#160;
+          <xsl:value-of select="$copyright/vendor"/>&#160;
+          <xsl:value-of select="$msg"/>
+        </xsl:variable>
+        <xsl:variable name="url" select="$copyright/url"/>
+
+        <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>
+
+<!-- Displays the current year after the inception year (in the copyright i.e: 2002-2005)
+       - the year format (yyyy by default can be indicated in the dateformat parameter,
+       - the dates separator (- by default) can be indicated in the dateseparator parameter.
+       For instance the following call will format the year on 2 digits and separates the dates
+       with /
+       (copyright 02/05)
+         <xsl:call-template name="current-year">
+           <xsl:with-param name="dateformat" select="'yy'"/>
+           <xsl:with-param name="dateseparator" select="'/'"/>
+         </xsl:call-template>
+       Warning 1 : to enable inception year, inception attribute must be set to "true" in skinconfig.xml
+       Fix Me ! This template is also defined in site2xhtml.xsl, We may need a stylesheet common to fo and XHTML ...
+-->
+  <xsl:template name="current-year">
+    <xsl:param name="dateformat">yyyy</xsl:param>
+    <xsl:param name="dateseparator">-</xsl:param>
+    <xsl:if test="$copyright/year[@inception = 'true']">
+      <xsl:variable name="tz" select='java:java.util.SimpleTimeZone.new(0,"GMT+00:00")' />
+      <xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new($dateformat)"/>
+      <xsl:variable name="settz" select="java:setTimeZone($formatter, $tz)" />
+      <xsl:variable name="date" select="java:java.util.Date.new()"/>
+      <xsl:variable name="year" select="java:format($formatter, $date)"/>
+      <xsl:if test="$copyright/year != $year">
+        <xsl:value-of select="$dateseparator"/><xsl:value-of select="$year"/>
+      </xsl:if>
+    </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-copyright.ft
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message