You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cd...@apache.org on 2006/01/16 17:51:21 UTC

svn commit: r369525 - in /forrest/trunk/main/template-sites/v3/src/documentation/resources/themes: common/html/nav-section.ft common/html/siteinfo-meta-navigation.ft pelt.fv

Author: cdupoirieux
Date: Mon Jan 16 08:51:15 2006
New Revision: 369525

URL: http://svn.apache.org/viewcvs?rev=369525&view=rev
Log:
siteinfo-meta-navigation.ft migration,
correction of the nav-section.ft usage.
(FOR-787)

Added:
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/siteinfo-meta-navigation.ft
      - copied, changed from r369411, forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/common/html/siteinfo-meta-navigation.ft
Modified:
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/nav-section.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/nav-section.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/nav-section.ft?rev=369525&r1=369524&r2=369525&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/nav-section.ft (original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/nav-section.ft Mon Jan 16 08:51:15 2006
@@ -31,7 +31,7 @@
     </div>
   </description>
   <!--FIXME: Please add describtion about the params used in the contract -->
-  <usage><![CDATA[<forrest:contract name="nav-section" dataURI="cocoon://#{$cocoon/parameters/getRequest}.toc.xml">
+  <usage><![CDATA[<forrest:contract name="nav-section" dataURI="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml">
   [<forrest:property name="nav-section-toc" nugget="get.toc">
     <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
   </forrest:property>]

Copied: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/siteinfo-meta-navigation.ft (from r369411, forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/common/html/siteinfo-meta-navigation.ft)
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/siteinfo-meta-navigation.ft?p2=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/siteinfo-meta-navigation.ft&p1=forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/common/html/siteinfo-meta-navigation.ft&r1=369411&r2=369525&rev=369525&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/common/html/siteinfo-meta-navigation.ft (original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/siteinfo-meta-navigation.ft Mon Jan 16 08:51:15 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  Copyright 2002-2006 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +15,9 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<forrest:contract name="siteinfo-meta-navigation" type="nugget" 
+<forrest:contract name="siteinfo-meta-navigation"
   xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
   <description>
     <p>
       <strong>siteinfo-meta-navigation</strong> will output the html additional navigation targets in head element.
@@ -24,77 +25,80 @@
       <div class="note">
       <div class="label">And why ?</div>
       <div class="content">
-        <p>This contract insert <code>&lt;link&gt;</code> HTML elements defined by <a href="http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-links" class="fork">W3C</a> 
+        <p>This contract insert <code>&lt;link&gt;</code> HTML elements defined by <a href="http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-links" class="fork">W3C</a>
         which can be interpreted by browsers to navigate between page.<br/>
         At the moment, the contract implements NEXT, PREVIOUS, LAST, FIRST, Index and CONTENT pages.
         </p>
       </div>
     </div>
   </description>
-  <usage><![CDATA[<forrest:contract name="siteinfo-meta-navigation">
-  <forrest:properties contract="nav-section">
-    <forrest:property name="nav-section" nugget="get.navigation">
-      <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
-    </forrest:property>
-  </forrest:properties>
-</forrest:contract>]]></usage>
-  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0" 
-    format="html" name="siteinfo-meta-navigation" inputFormat="xsl" 
-    body="false" head="true">
-    <xsl:stylesheet version="1.1" 
-      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <usage><![CDATA[<forrest:contract name="siteinfo-meta-navigation" dataURI="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>]]></usage>
+
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="siteinfo-meta-navigation" inputFormat="xsl">
+    <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+      <xsl:param name="defaultVariables" select="'test.html'"/>
+      <xsl:param name="nav-main" select="/"/>
+      <xsl:variable name="root" select="$defaultVariables/*/*[@name='root']/@value"/>
+
       <!-- ********************************** -->
       <!-- Creates navigation links in header -->
       <!-- ********************************** -->
-      <xsl:template name="siteinfo-meta-navigation-head">
-        <xsl:param name="nav-main" select="'test'"/>
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part  xpath="/html/head">
+            <xsl:comment>+ |start navigation links +</xsl:comment>
 
-        <!-- Index and Table of Contents -->
-        <xsl:call-template name="navigation-link-index-content"/>
+            <!-- Index and Table of Contents -->
+            <xsl:call-template name="navigation-link-index-content"/>
 
-        <!-- NEXT, PREVIOUS... -->
-        <xsl:for-each select="$nav-main/navigation/menu/div[@id='menu']//div[@class='current']">
-          <!-- NEXT -->
-          <xsl:if test="ancestor::node()/following-sibling::*[1]//a">
-            <link rel="NEXT" 
-              href="{ancestor::node()/following-sibling::*[1]//a/@href}"
-              title="{ancestor::node()/following-sibling::*[1]//a}">
-            </link>
-          </xsl:if>
-          <!-- PREVIOUS -->
-          <xsl:for-each 
-            select="ancestor::node()/preceding-sibling::*[1]//a[not( starts-with( @class, 'base' ) )]">
-            <xsl:if test="position()=last()">
-              <link rel="PREVIOUS" href="{./@href}">
-                <xsl:attribute name="title">
-                  <xsl:value-of select="."/>
-                </xsl:attribute>
-              </link>
-            </xsl:if>
-          </xsl:for-each>
-          <!-- LAST -->
-          <xsl:if test="parent::node()/following-sibling::*[last()]/a">
-            <link rel="LAST" 
-              href="{parent::node()/following-sibling::*[last()]/a/@href}">
-              <xsl:attribute name="title">
-                <xsl:value-of 
-                  select="parent::node()/following-sibling::*[last()]/a" />
-              </xsl:attribute>
-            </link>
-          </xsl:if>
-          <!-- FIRST -->
-          <xsl:if test="parent::node()/preceding-sibling::*[last()]/a">
-            <link rel="FIRST" 
-              href="{parent::node()/preceding-sibling::*[last()]/a/@href}">
-              <xsl:attribute name="title">
-                <xsl:value-of 
-                  select="parent::node()/preceding-sibling::*[last()]/a"/>
-              </xsl:attribute>
-            </link>
-          </xsl:if>
-        </xsl:for-each>
+            <!-- NEXT, PREVIOUS... -->
+            <xsl:for-each select="$nav-main/navigation/menu/div[@id='menu']//div[@class='current']">
+              <!-- NEXT -->
+              <xsl:if test="ancestor::node()/following-sibling::*[1]//a">
+                <link rel="NEXT"
+                  href="{ancestor::node()/following-sibling::*[1]//a/@href}"
+                  title="{ancestor::node()/following-sibling::*[1]//a}">
+                </link>
+              </xsl:if>
+              <!-- PREVIOUS -->
+              <xsl:for-each
+                select="ancestor::node()/preceding-sibling::*[1]//a[not( starts-with( @class, 'base' ) )]">
+                <xsl:if test="position()=last()">
+                  <link rel="PREVIOUS" href="{./@href}">
+                    <xsl:attribute name="title">
+                      <xsl:value-of select="."/>
+                    </xsl:attribute>
+                  </link>
+                </xsl:if>
+              </xsl:for-each>
+              <!-- LAST -->
+              <xsl:if test="parent::node()/following-sibling::*[last()]/a">
+                <link rel="LAST"
+                  href="{parent::node()/following-sibling::*[last()]/a/@href}">
+                  <xsl:attribute name="title">
+                    <xsl:value-of
+                      select="parent::node()/following-sibling::*[last()]/a" />
+                  </xsl:attribute>
+                </link>
+              </xsl:if>
+              <!-- FIRST -->
+              <xsl:if test="parent::node()/preceding-sibling::*[last()]/a">
+                <link rel="FIRST"
+                  href="{parent::node()/preceding-sibling::*[last()]/a/@href}">
+                  <xsl:attribute name="title">
+                    <xsl:value-of
+                      select="parent::node()/preceding-sibling::*[last()]/a"/>
+                  </xsl:attribute>
+                </link>
+              </xsl:if>
+            </xsl:for-each>
+            <xsl:comment>+ |end navigation links +</xsl:comment>
+          </forrest:part>
+        </forrest:content>
       </xsl:template>
-      
+
       <!-- extraction of the Index and the table of content in order to, possibly, overide them in skins... -->
       <xsl:template name="navigation-link-index-content">
         <!-- Index ... -->

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv?rev=369525&r1=369524&r2=369525&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv (original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv Mon Jan 16 08:51:15 2006
@@ -212,15 +212,7 @@
     -->
     <forrest:contract name="siteinfo-meta" dataURI="lm://project.build-info"/>
 
-<!--
-    <forrest:contract name="siteinfo-meta-navigation">
-      <forrest:properties contract="siteinfo-meta-navigation">
-        <forrest:property name="nav-main" nugget="get.navigation">
-          <jx:import uri="cocoon://${cocoon.parameters.getRequest}.navigation.xml"/>
-        </forrest:property>
-      </forrest:properties>
-    </forrest:contract>
-    -->
+    <forrest:contract name="siteinfo-meta-navigation" dataURI="cocoon://#{$getRequest}.navigation.xml"/>
     <forrest:contract name="siteinfo-meta-icon">
       <forrest:property name="siteinfo-meta-icon">
         <favicon-url>favicon.ico</favicon-url>
@@ -294,10 +286,7 @@
         </forrest:contract>
 
         <forrest:hook name="leftbar">
-          <forrest:contract name="nav-section">
-              <forrest:property name="nav-section" nugget="get.navigation">
-                <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
-              </forrest:property>
+          <forrest:contract name="nav-section" dataURI="cocoon://#{$getRequest}.navigation.xml">
               <forrest:property name="nav-section-toc" nugget="get.tov">
                 <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
               </forrest:property>