You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by fe...@apache.org on 2007/05/17 18:12:22 UTC

svn commit: r538993 - in /cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html: adding-header.xsl simple-header.xsl simple-page2html.xsl

Author: felixk
Date: Thu May 17 09:12:21 2007
New Revision: 538993

URL: http://svn.apache.org/viewvc?view=rev&rev=538993
Log:
What is needed to make this links working are the following entries in the block/*sample sitemap:

<map:views>
 <map:view from-label="content" name="content">
  <map:serialize type="xml" />
 </map:view>
 <map:view from-label="content" name="pretty-content">
  <!-- Make use of servlet services -->
  <map:serialize type="servletService" mime-type="text/html">
   <map:parameter name="service" value="servlet:style-default:/service/system/xml2html" />
  </map:serialize>
 </map:view>
 <map:view from-position="last" name="links">
  <map:serialize type="links" />
 </map:view>
</map:views>

and in a pipeline (for the sitemap)
<map:match pattern="sitemap.xmap">
  <map.read src="sitemap.xmap" mime-type="text/xlm"/>
</map:match">

Modified:
    cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/adding-header.xsl
    cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-header.xsl
    cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-page2html.xsl

Modified: cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/adding-header.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/adding-header.xsl?view=diff&rev=538993&r1=538992&r2=538993
==============================================================================
--- cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/adding-header.xsl (original)
+++ cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/adding-header.xsl Thu May 17 09:12:21 2007
@@ -16,16 +16,11 @@
   limitations under the License.
 -->
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:param name="servletPath" select="string('/samples')"/>
-  <xsl:param name="sitemapURI"/>
-  <xsl:variable name="directory" select="substring-before($servletPath,$sitemapURI)"/>
-  <!-- assume that sitemapURIs don't occur in servletPath more than once -->
-  <xsl:variable name="sitemap" select="concat($directory,'sitemap.xmap')"/>
   <xsl:template match="body">
     <div style="text-align:right;width:100%;">
       <a href="?cocoon-view=content">Content View</a> |
       <a href="?cocoon-view=pretty-content">Source</a> |
-      <a href="{$sitemap}?cocoon-view=pretty-content">Sitemap</a>
+      <a href="sitemap.xmap?cocoon-view=pretty-content">Sitemap</a>
     </div>
     <xsl:apply-templates/>
   </xsl:template>

Modified: cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-header.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-header.xsl?view=diff&rev=538993&r1=538992&r2=538993
==============================================================================
--- cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-header.xsl (original)
+++ cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-header.xsl Thu May 17 09:12:21 2007
@@ -16,16 +16,11 @@
   limitations under the License.
 -->
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:param name="servletPath" select="string('/samples')"/>
-  <xsl:param name="sitemapURI"/>
-  <xsl:variable name="directory" select="substring-before($servletPath,$sitemapURI)"/>
-  <!-- assume that sitemapURIs don't occur in servletPath more than once -->
-  <xsl:variable name="sitemap" select="concat($directory,'sitemap.xmap')"/>
   <xsl:template match="body">
     <div style="text-align:right;width:100%;">
       <a href="?cocoon-view=content">Content View</a> |
       <a href="?cocoon-view=pretty-content">Source</a> |
-      <a href="{$sitemap}?cocoon-view=pretty-content">Sitemap</a>
+      <a href="sitemap.xmap?cocoon-view=pretty-content">Sitemap</a>
     </div>
     <xsl:apply-templates/>
   </xsl:template>

Modified: cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-page2html.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-page2html.xsl?view=diff&rev=538993&r1=538992&r2=538993
==============================================================================
--- cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-page2html.xsl (original)
+++ cocoon/trunk/blocks/cocoon-samples-style/cocoon-samples-style-default/src/main/resources/COB-INF/common/style/xsl/html/simple-page2html.xsl Thu May 17 09:12:21 2007
@@ -18,14 +18,6 @@
 
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
-  <xsl:param name="contextPath">servlet:/</xsl:param>
-  <xsl:param name="servletPath" select="string('/samples')"/>
-  <xsl:param name="sitemapURI"/>
-
-  <xsl:variable name="directory" select="substring-before($servletPath,$sitemapURI)"/>
-  <!-- assume that sitemapURIs don't occur in servletPath more than once -->
-  <xsl:variable name="sitemap" select="concat($directory,'sitemap.xmap')"/>
-
   <xsl:template match="page">
    <html>
      <head>
@@ -45,7 +37,7 @@
     <div class="resources">
       <a href="?cocoon-view=content">Content View</a>
       <a href="?cocoon-view=pretty-content">Source</a>
-      <a href="{$sitemap}?cocoon-view=pretty-content">Sitemap</a>
+      <a href="sitemap.xmap?cocoon-view=pretty-content">Sitemap</a>
       <xsl:for-each select="resources/resource">
         <xsl:variable name="href">
           <xsl:choose>
@@ -55,10 +47,10 @@
               <xsl:value-of select="@href"/>
             </xsl:when>
             <xsl:when test="@type='doc'">
-              <xsl:value-of select="concat($contextPath, '/docs/', @href)"/>
+              <xsl:value-of select="concat('docs/', @href)"/>
             </xsl:when>
             <xsl:otherwise>
-              <xsl:value-of select="concat($contextPath, '/', @href)"/>
+              <xsl:value-of select="@href"/>
             </xsl:otherwise>
           </xsl:choose>
         </xsl:variable>