You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2006/06/15 00:37:08 UTC

svn commit: r414402 - in /lenya/branches/revolution/1.3.x: ./ src/webapp/lenya/modules/flat/index/ src/webapp/lenya/modules/homepage/ src/webapp/lenya/modules/live/ src/webapp/lenya/modules/nav/ src/webapp/lenya/modules/navigation/

Author: solprovider
Date: Wed Jun 14 15:37:07 2006
New Revision: 414402

URL: http://svn.apache.org/viewvc?rev=414402&view=rev
Log:
Changed index live.xconf to use "livemenu" structure.  If you have previously migrated content, rename {pub}/content/index/livemenu* -> live*  (overwrite the old files)

Navigation Module: Fixed bug and passes to "nav" Module if flat content.
Nav Module: Navigation elements for flat content.
Added backwards-compatible instructions to 13UPGRADE.txt for fixing links when using the Nav Module.

Added:
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl   (with props)
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl   (with props)
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap   (with props)
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml   (with props)
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl   (with props)
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl   (with props)
Removed:
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/livemenu.xconf
Modified:
    lenya/branches/revolution/1.3.x/13UPGRADE.txt
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml

Modified: lenya/branches/revolution/1.3.x/13UPGRADE.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13UPGRADE.txt?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13UPGRADE.txt (original)
+++ lenya/branches/revolution/1.3.x/13UPGRADE.txt Wed Jun 14 15:37:07 2006
@@ -23,6 +23,25 @@
 If you move the content directory, change the value.
 
 
+If using flat content and the "nav" Module is included, the "navigation" Module will pass control to the "nav" Module.  The "nav" Module expects PageModules (Modules that return HTML) to prefix navigation elements with the publication and module names.  Add the following lines to "page2xhtml.xsl" and similar files:
+
+NEAR THE TOP:
+<xsl:param name="contenttype"/>
+
+NEAR THE BOTTOM:
+<!-- 1.3 Nav Module Path Correction -->
+<xsl:template match="//xhtml:div[@id != 'body']//*/@href"><xsl:choose>
+<xsl:when test="$contenttype='flat'"><xsl:attribute name="href"><xsl:value-of select="$root"/><xsl:value-of select="."/></xsl:attribute></xsl:when>
+<xsl:otherwise><xsl:copy/></xsl:otherwise>
+</xsl:choose></xsl:template>
+
+AND in the XMAP "module.xmap", add the contenttype parameter to the map:transform:
+<map:transform src="module:///page2xhtml.xsl">
+   <map:parameter name="contenttype" value="{publication:contenttype}"/>
+   <!-- other parameters, including "root" -->
+</map:transform
+
+
 === Converting Usecases to Modules
 In your {pub} directory, create a directory names "modules".
 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf Wed Jun 14 15:37:07 2006
@@ -1,2 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<index structure="live"/>
+<index structure="livemenu">
+<filter property="type">xml</filter>
+<filter property="doctype">xhtml|link</filter>
+</index>
\ No newline at end of file

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap Wed Jun 14 15:37:07 2006
@@ -17,18 +17,19 @@
             <!-- Get the current document -->
             <map:match pattern="*/cocoon/**">
                <map:aggregate element="cmsbody">
-                  <map:part src="cocoon://{page-envelope:publication-id}/session/info"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/xhtml/view/live/index_{page-envelope:document-language}.html"/>
+                  <map:part src="cocoon://{publication:publication}/session/info"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/xhtml/view/live/index_{page-envelope:document-language}.html"/>
                </map:aggregate>
                <map:transform type="i18n" label="debug">
                   <map:parameter name="locale" value="{page-envelope:document-language}"/>
                </map:transform>
-               <map:transform src="module:///page2xhtml.xsl" label="debug">
-                 <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/live"/>
+               <map:transform src="module:///page2xhtml.xsl">
+                 <map:parameter name="contenttype" value="{publication:contenttype}"/>
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/live"/>
                  <map:parameter name="url" value="{2}"/>
                  <map:parameter name="document-id" value="{page-envelope:document-id}"/>
                  <map:parameter name="document-name" value="{page-envelope:document-name}"/>
@@ -51,7 +52,7 @@
                   <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
                   <map:serialize type="html"/>
                </map:act>
-               <map:generate src="cocoon:/{module:module}/cocoon/{page-envelope:publication-id}/{page-envelope:document-type}/view/{page-envelope:area}/index_{page-envelope:document-language}.xml"/>
+               <map:generate src="cocoon:/{module:module}/cocoon/{publication:publication}/{page-envelope:document-type}/view/{page-envelope:area}/index_{page-envelope:document-language}.xml"/>
                <map:serialize type="html"/>
             </map:match>
 <!-- Default: Add Language -->

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl Wed Jun 14 15:37:07 2006
@@ -29,7 +29,7 @@
     exclude-result-prefixes="page xhtml"
     >
     
-    
+<xsl:param name="contenttype"/>
 <!-- {context-prefix}/{publication-id}/{area} -->
 <xsl:param name="root"/>
 
@@ -126,6 +126,12 @@
     </xsl:choose>
   </xsl:if>
 </xsl:template>
+
+<!-- 1.3 Nav Module Path Correction -->
+<xsl:template match="//xhtml:div[@id != 'body']//*/@href"><xsl:choose>
+<xsl:when test="$contenttype='flat'"><xsl:attribute name="href"><xsl:value-of select="$root"/><xsl:value-of select="."/></xsl:attribute></xsl:when>
+<xsl:otherwise><xsl:copy/></xsl:otherwise>
+</xsl:choose></xsl:template>
 
 <xsl:template match="@*|node()" priority="-1">
   <xsl:copy>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap Wed Jun 14 15:37:07 2006
@@ -25,19 +25,20 @@
             <!-- Get the current document -->
             <map:match pattern="*/cocoon/live/**">
                <map:aggregate element="cmsbody">
-                  <map:part src="cocoon://{page-envelope:publication-id}/session/info"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/session/info"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
 <!--  WORK: Get doctype from Resource -->
-                  <map:part src="cocoon://{page-envelope:publication-id}/xhtml/view/live/{2}"/>
+                  <map:part src="cocoon://{publication:publication}/xhtml/view/live/{2}"/>
                </map:aggregate>
                <map:transform type="i18n" label="debug">
                   <map:parameter name="locale" value="{page-envelope:document-language}"/>
                </map:transform>
-               <map:transform src="module:///page2xhtml.xsl" label="debug">
-                 <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/live"/>
+               <map:transform src="module:///page2xhtml.xsl">
+                 <map:parameter name="contenttype" value="{publication:contenttype}"/>
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/live"/>
                  <map:parameter name="url" value="{2}"/>
                  <map:parameter name="document-id" value="{page-envelope:document-id}"/>
                  <map:parameter name="document-name" value="{page-envelope:document-name}"/>
@@ -46,7 +47,7 @@
                  <map:parameter name="language" value="{page-envelope:document-language}"/>
                  <map:parameter name="querystring" value="{request:queryString}"/>
                </map:transform>
-               <map:transform type="i18n" label="debug">
+               <map:transform type="i18n">
                   <map:parameter name="locale" value="{page-envelope:document-language}"/>
                </map:transform>
                <map:serialize type="html"/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl Wed Jun 14 15:37:07 2006
@@ -29,7 +29,7 @@
     exclude-result-prefixes="page xhtml"
     >
     
-    
+<xsl:param name="contenttype"/>
 <!-- {context-prefix}/{publication-id}/{area} -->
 <xsl:param name="root"/>
 
@@ -79,7 +79,7 @@
             <div id="main">
               <xsl:apply-templates select="xhtml:div[@id = 'breadcrumb']"/>
               <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
-              <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
+              <xsl:apply-templates select="xhtml:html/xhtml:div[@id = 'body']"/>
             </div>
           </td>
         </tr>
@@ -126,6 +126,12 @@
     </xsl:choose>
   </xsl:if>
 </xsl:template>
+
+<!-- 1.3 Nav Module Path Correction -->
+<xsl:template match="//xhtml:div[@id != 'body']//*/@href"><xsl:choose>
+<xsl:when test="$contenttype='flat'"><xsl:attribute name="href"><xsl:value-of select="$root"/><xsl:value-of select="."/></xsl:attribute></xsl:when>
+<xsl:otherwise><xsl:copy/></xsl:otherwise>
+</xsl:choose></xsl:template>
 
 <xsl:template match="@*|node()" priority="-1">
   <xsl:copy>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl Wed Jun 14 15:37:07 2006
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    >
+
+<xsl:param name="current"/>
+<xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
+<xsl:variable name="currentfull">/<xsl:value-of select="$current"/></xsl:variable>
+    
+<xsl:template match="/index">
+  <div id="breadcrumb">
+    <xsl:apply-templates select="resource[descendant-or-self::resource[@fullid = $currentfull]]"/>
+</div>
+</xsl:template>
+
+<xsl:template match="resource">
+    <xsl:call-template name="separator"/>
+    <xsl:call-template name="step"/>
+    <xsl:apply-templates select="resource[descendant-or-self::resource[@fullid = $currentfull]]"/>
+</xsl:template>
+
+<xsl:template name="step">
+   <xsl:variable name="extension"><xsl:choose>
+<xsl:when test="@extension"><xsl:value-of select="@extension"/></xsl:when>
+<xsl:otherwise>html</xsl:otherwise>
+</xsl:choose></xsl:variable>
+  <xsl:choose>
+    <xsl:when test="@fullid = $currentfull">
+       <xsl:value-of select="@title"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:element name="a">
+        <xsl:attribute name="href"><xsl:value-of select="@fullid"/>_<xsl:value-of select="$language"/>.<xsl:value-of select="$extension"/></xsl:attribute>
+        <xsl:value-of select="@title"/>
+     </xsl:element>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="separator">
+  &#x00BB;
+</xsl:template>
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/breadcrumb.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl Wed Jun 14 15:37:07 2006
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    >
+    
+<xsl:param name="current"/>
+<xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
+<xsl:variable name="currentfull">/<xsl:value-of select="$current"/></xsl:variable>
+
+<xsl:template match="/index">
+  <div id="menu">
+    <xsl:apply-templates select="resource"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="resource">
+  <xsl:choose>
+    <xsl:when test="descendant-or-self::resource[@fullid = $currentfull]">
+      <div class="menublock-selected" level="{count(ancestor-or-self::nav:node)}">
+        <xsl:call-template name="item"/>
+        <xsl:apply-templates select="resource"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <div class="menublock" level="{count(ancestor-or-self::resource)}">
+        <xsl:call-template name="item"/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="item">
+      <xsl:choose>
+         <xsl:when test="@fullid = $currentfull">
+           <xsl:call-template name="item-selected"/>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:call-template name="item-default"/>
+         </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="item-default">
+   <xsl:variable name="extension"><xsl:choose>
+<xsl:when test="@extension"><xsl:value-of select="@extension"/></xsl:when>
+<xsl:otherwise>html</xsl:otherwise>
+</xsl:choose></xsl:variable>
+  <div class="menuitem" level="{count(ancestor-or-self::resource)}" id="{@id}">
+     <xsl:element name="a">
+        <xsl:attribute name="href"><xsl:value-of select="@fullid"/>_<xsl:value-of select="$language"/>.<xsl:value-of select="$extension"/></xsl:attribute>
+        <xsl:value-of select="@title"/>
+     </xsl:element>
+  </div>
+</xsl:template>
+
+<xsl:template name="item-selected">
+  <div class="menuitem-selected" level="{count(ancestor-or-self::resource)}" id="{@id}">
+     <xsl:value-of select="@title"/>
+  </div>
+</xsl:template>
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap Wed Jun 14 15:37:07 2006
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Nav Module -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <!-- =========================== Components ================================ -->
+  <map:components>
+  <map:views>
+    <map:view name="nav" from-label="nav">
+       <map:serialize type="xml"/>
+    </map:view> 
+  </map:views>
+  </map:components>
+  <!-- =========================== Resources ================================ -->
+  <map:resources>
+    <map:resource name="finish">
+      <map:transform src="module://{stylesheet}">
+        <map:parameter name="current" value="{url}"/>
+      </map:transform>
+      <map:serialize type="xml"/>      
+    </map:resource>
+  </map:resources>
+  <!-- =========================== Pipelines ================================ -->
+  <map:pipelines>
+    <map:pipeline>
+   <map:match pattern="**">
+    <!-- pattern: {pub-id}/admin/{nav-element}/{url}.xml -->
+<!-- Not tested -->
+    <map:match pattern="admin/*/**.xml">
+      <map:generate src="cocoon:/{publication:publication}/admin/sitetree/{2}.xml"/>
+      <map:call resource="finish">
+        <map:parameter name="stylesheet" value="/admin-{page-envelope:area}.xsl"/>
+      </map:call>
+    </map:match>
+<!-- REMOVE publication -->
+      <map:match pattern="{publication:publication}/**">
+         <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>      
+      </map:match>
+<!-- REMOVE navigation module -->
+      <map:match pattern="{module:module}/**">
+        <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>      
+      </map:match>
+<!-- REMOVE Language -->
+      <map:match pattern="**/*_*">
+         <map:generate src="cocoon:/{1}/{2}"/>
+         <map:serialize type="xml"/>   
+      </map:match>
+<!-- REMOVE extension -->
+       <map:match pattern="**/*.*">
+         <map:generate src="cocoon:/{1}/{2}"/>
+         <map:serialize type="xml"/>   
+      </map:match>
+<!--  {menu}/{indexname} -->
+      <map:match pattern="*/**">
+       <map:match pattern="*/*/**">
+<!-- Module XMAP -->
+         <map:act type="resource-exists" src="module://{1}/{module:module}.xmap">
+            <map:mount uri-prefix="" src="module://{../1}/{module:module}.xmap"/> 
+            <map:serialize type="xml"/>
+        </map:act>
+<!-- Module XSL -->
+         <map:act type="resource-exists" src="module://{1}/{module:module}.xsl">
+            <map:generate type="sitetree" src="{../2}"/>
+            <map:call resource="finish">
+              <map:parameter name="stylesheet" value="{../1}/{module:module}.xsl"/>
+              <map:parameter name="url" value="{../3}"/>
+            </map:call>
+        </map:act>
+<!-- Local XSL -->
+        <map:generate type="sitetree" src="{2}"/>
+        <map:call resource="finish">
+           <map:parameter name="stylesheet" value="/{1}.xsl"/>
+           <map:parameter name="url" value="{3}"/>
+        </map:call>
+         <map:serialize type="xml"/>   
+       </map:match>
+      </map:match>
+<!-- Default -->
+        <map:generate type="sitetree" src="live"/>
+        <map:serialize type="xml"/>
+   </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml Wed Jun 14 15:37:07 2006
@@ -0,0 +1,27 @@
+<module id="nav" name="Navigation">
+<version>Flat</version>
+<description>Handles navigation framework for flat storage using SitetreeGenerator.</description>
+<usage>
+<map:generate src="module://nav/{navigation-element}/{index}/{resource-fullid}"/>
+
+This Module strips irrelevant information, so:
+module://nav/menu/live/myPath/myDoc_xx.html
+BECOMES:
+menu/live/myPath/myDoc
+
+It tries to pass this to a file named nav.xmap in a Module named {navigation-element}.
+If that does not exist, it generates the index.  
+It then tries to transform using a file named nav.xsl in a Module named {navigation-element}.
+If that does not exist, it transforms using a file named {navigation-element}.xsl from this Module.
+
+These XSL should start with;
+<xsl:param name="current"/>
+<xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
+<xsl:variable name="currentfull">/<xsl:value-of select="$current"/></xsl:variable>
+
+$currentfull contains the currently selected fullid.
+$language contains the current language.
+
+The results are specific to the Navigation Element.  Later XSL would usually add a prefix to anchor tags.
+</usage>
+</module>
\ No newline at end of file

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl Wed Jun 14 15:37:07 2006
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    >
+
+<xsl:param name="current"/>
+<xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
+<xsl:variable name="currentfull">/<xsl:value-of select="$current"/></xsl:variable>
+
+<xsl:template match="/index">
+  <div id="tabs">
+    <xsl:call-template name="pre-separator"/>
+    <xsl:apply-templates select="resource"/>
+    <xsl:call-template name="post-separator"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="resource">
+      <xsl:if test="position() &gt; 1">
+        <xsl:call-template name="separator"/>
+      </xsl:if>
+      <xsl:choose>
+        <xsl:when test="descendant-or-self::resource[@fullid = $currentfull]">
+<testD fullid="{@fullid}"/>
+          <xsl:call-template name="tab-selected"/>
+        </xsl:when>
+        <xsl:otherwise>
+<test fullid="{@fullid}"/>
+          <xsl:call-template name="tab"/>
+        </xsl:otherwise>
+      </xsl:choose>
+</xsl:template>
+
+<xsl:template name="tab">
+  <span class="tab"><xsl:call-template name="label"/></span>
+</xsl:template>
+
+
+<xsl:template name="tab-selected">
+  <span class="tab-selected"><xsl:call-template name="label"/></span>
+</xsl:template>
+
+<xsl:template name="label">
+<xsl:variable name="extension"><xsl:choose>
+<xsl:when test="@extension"><xsl:value-of select="@extension"/></xsl:when>
+<xsl:otherwise>html</xsl:otherwise>
+</xsl:choose></xsl:variable>
+
+   <xsl:choose>
+    <xsl:when test="@fullid = $currentfull"><xsl:value-of select="@title"/></xsl:when>
+    <xsl:otherwise>
+     <xsl:element name="a">
+        <xsl:attribute name="href"><xsl:value-of select="@fullid"/>_<xsl:value-of select="$language"/>.<xsl:value-of select="$extension"/></xsl:attribute>
+        <xsl:value-of select="@title"/>
+     </xsl:element>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="pre-separator">
+</xsl:template>
+
+<xsl:template name="separator">
+   <xsl:text>&#160;</xsl:text>
+</xsl:template>
+
+<xsl:template name="post-separator">
+</xsl:template>
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabs.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl?rev=414402&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl Wed Jun 14 15:37:07 2006
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    >
+
+<xsl:param name="current"/>
+<xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
+<xsl:variable name="currentfull">/<xsl:value-of select="$current"/></xsl:variable>
+
+<xsl:template match="/index">
+  <div id="tabsall">
+     <div id="tabslevel">
+       <xsl:apply-templates select="resource" mode="tabslevel"/>
+     </div>
+     <xsl:apply-templates select="resource"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="resource[descendant-or-self::resource[@fullid = $currentfull]]">
+  <div id="tabslevel">
+    <xsl:apply-templates select="resource" mode="tabslevel"/>
+  </div>
+  <xsl:apply-templates select="resource"/>
+</xsl:template>
+
+<xsl:template match="resource" mode="tabslevel">
+       <xsl:choose>
+        <xsl:when test="@fullid = $currentfull">
+          <xsl:call-template name="tab-selected"/>
+        </xsl:when>
+        <xsl:when test="descendant-or-self::resource[@fullid = $currentfull]">
+          <xsl:call-template name="tablevel-selected"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="tab"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:text>&#160;</xsl:text>
+</xsl:template>
+
+<xsl:template match="resource" priority="-1"/>
+
+<xsl:template name="tab">
+  <span class="tabsall-tab"><xsl:call-template name="label"/></span>
+</xsl:template>
+
+<xsl:template name="tab-selected">
+  <span class="tabsall-selected"><xsl:call-template name="label"/></span>
+</xsl:template>
+<xsl:template name="tablevel-selected">
+  <span class="tabsall-levelselected"><xsl:call-template name="label"/></span>
+</xsl:template>
+
+<xsl:template name="label">
+<xsl:variable name="extension"><xsl:choose>
+<xsl:when test="@extension"><xsl:value-of select="@extension"/></xsl:when>
+<xsl:otherwise>html</xsl:otherwise>
+</xsl:choose></xsl:variable>
+
+   <xsl:choose>
+    <xsl:when test="@fullid = $currentfull"><xsl:value-of select="@title"/>
+</xsl:when>
+    <xsl:otherwise>     
+<xsl:element name="a">
+        <xsl:attribute name="href"><xsl:value-of select="@fullid"/>_<xsl:value-of select="$language"/>.<xsl:value-of select="$extension"/></xsl:attribute>
+        <xsl:value-of select="@title"/>
+     </xsl:element>
+</xsl:otherwise>
+  </xsl:choose>	  
+</xsl:template>
+
+
+<xsl:template match="@*|node()" priority="-2"/>
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/tabsall.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap Wed Jun 14 15:37:07 2006
@@ -1,9 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-This sitemap creates default navigation components.
--->
-
+<!-- Navigation Module -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <!-- =========================== Components ================================ -->
 
@@ -23,7 +19,7 @@
     <map:resource name="finish">
       <map:transform src="module://{stylesheet}">
         <map:parameter name="url" value="{url}"/>
-        <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/{page-envelope:area}/"/>
+        <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/{page-envelope:area}/"/>
         <map:parameter name="area" value="{page-envelope:area}"/>
         <map:parameter name="chosenlanguage" value="{page-envelope:document-language}"/>
         <map:parameter name="defaultlanguage" value="{page-envelope:document-language}"/>
@@ -36,16 +32,15 @@
   <map:pipelines>
     <map:pipeline>
    <map:match pattern="**">
-    <!-- pattern: {pub-id}/admin/{nav-element}/{url}.xml -->
 <!-- Not tested -->
     <map:match pattern="admin/*/**.xml">
-      <map:generate src="cocoon:/{page-envelope:publication-id}/admin/sitetree/{2}.xml"/>
+      <map:generate src="cocoon:/{publication:publication}/admin/sitetree/{2}.xml"/>
       <map:call resource="finish">
         <map:parameter name="stylesheet" value="/admin-{page-envelope:area}.xsl"/>
       </map:call>
     </map:match>
 <!-- REMOVE publication -->
-      <map:match pattern="{page-envelope:publication-id}/**">
+      <map:match pattern="{publication:publication}/**">
          <map:generate src="cocoon:/{1}"/>
          <map:serialize type="xml"/>      
       </map:match>
@@ -77,21 +72,32 @@
       </map:match>
 <!-- Nav -->
       <map:match pattern="*/**">
+<!-- Pass to Nav Module if Flat Content -->
+      <map:select type="parameter">
+         <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
+         <map:when test="flat">
+            <map:act type="resource-exists" src="module://nav">
+               <map:generate src="cocoon://{publication:publication}/nav/{../1}/{page-envelope:area}/{../2}"/>
+               <map:serialize type="xml"/>
+            </map:act>
+         </map:when>
+      </map:select>
+    <!-- pattern: {pub-id}/admin/{nav-element}/{url}.xml -->
 <!-- Navigation Module XMAP -->
-         <map:act type="resource-exists" src="module:///module://{1}/navigation.xmap">
-            <map:mount uri-prefix="" src="module:///module://{1}/navigation.xmap"/> 
+         <map:act type="resource-exists" src="module://{1}/{module:module}.xmap">
+            <map:mount uri-prefix="" src="module://{1}/{module:module}.xmap"/> 
             <map:serialize type="xml"/>
         </map:act>
 <!-- Navigation Module XSL -->
-         <map:act type="resource-exists" src="module:///module://{1}/navigation.xsl">
-            <map:generate src="module:///cocoon:/sitetree/{2}"/>
+         <map:act type="resource-exists" src="module://{1}/{module:module}.xsl">
+            <map:generate src="cocoon:/sitetree/{2}"/>
             <map:call resource="finish">
-              <map:parameter name="stylesheet" value="{../1}/navigation.xsl"/>
+              <map:parameter name="stylesheet" value="{../1}/{module:module}.xsl"/>
               <map:parameter name="url" value="{../2}.html"/>
             </map:call>
         </map:act>
 <!-- Navigation XSL -->
-        <map:generate src="module:///cocoon:/sitetree/{2}"/>
+        <map:generate src="cocoon:/sitetree/{2}"/>
         <map:call resource="finish">
            <map:parameter name="stylesheet" value="/{1}.xsl"/>
            <map:parameter name="url" value="{2}.html"/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml?rev=414402&r1=414401&r2=414402&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml Wed Jun 14 15:37:07 2006
@@ -1,5 +1,5 @@
 <module id="navigation" name="Navigation">
 <version>1.3</version>
 <content>Hierarchical</content>
-<description>Handles backwards-compatible navigation framework for hierarchical storage.</description>
+<description>Handles backwards-compatible navigation framework for hierarchical storage.  Passes to "nav" Module if flat content.</description>
 </module>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org