You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2005/07/12 05:22:32 UTC
svn commit: r215918 - in
/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources:
stylesheets/prepare.include.templates.xsl
templates/siteinfo-meta-navigation.ft
Author: thorsten
Date: Mon Jul 11 20:22:29 2005
New Revision: 215918
URL: http://svn.apache.org/viewcvs?rev=215918&view=rev
Log:
fixes FOR-320. Thanks for the patch Cyriaque Dupoirieux. I refactored it to a contract. Also deleted obsolete stylesheet.
Added:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft (with props)
Removed:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/stylesheets/prepare.include.templates.xsl
Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft?rev=215918&view=auto
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft Mon Jul 11 20:22:29 2005
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 name="siteinfo-meta-navigation" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ This functions will output the html additional navigation in head element.
+ Implemented forrest version/skin name.
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-meta-navigation"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="xhtml" name="siteinfo-meta-navigation" inputFormat="xsl" body="false" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-meta-navigation-head">
+ <xsl:call-template name="navigation-link-header"/>
+ </xsl:template>
+ <!-- ********************************** -->
+ <!-- Creates navigation links in header -->
+ <!-- ********************************** -->
+ <xsl:template name="navigation-link-header">
+ <!-- Index and Table of Contents -->
+ <xsl:call-template name="navigation-link-index-content"/>
+ <!-- NEXT, PREVIOUS... -->
+ <xsl:for-each select="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}">
+ <xsl:attribute name="title">
+ <xsl:value-of
+ select="ancestor::node()/following-sibling::*[1]//a" />
+ </xsl:attribute>
+ </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: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 ... -->
+ <link rel="Index" href="{$root}index.html">
+ <xsl:attribute name="title">Index...</xsl:attribute>
+ </link>
+ <!-- Site map ... -->
+ <link rel="CONTENTS" href="{$root}linkmap.html">
+ <xsl:attribute name="title">Site map...</xsl:attribute>
+ </link>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/siteinfo-meta-navigation.ft
------------------------------------------------------------------------------
svn:keywords = Id svn:eol-style=native