forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject svn commit: rev 21190 - in forrest/trunk/src: core/context core/context/resources/stylesheets java/org/apache/forrest/conf java/org/apache/forrest/skinconf
Date Mon, 14 Jun 2004 07:06:36 GMT
Author: nicolaken
Date: Mon Jun 14 00:06:35 2004
New Revision: 21190

Added:
   forrest/trunk/src/core/context/resources/stylesheets/declare-broken-site-links.xsl
   forrest/trunk/src/java/org/apache/forrest/conf/SkinconfTransformer.java
      - copied, changed from rev 21189, forrest/trunk/src/java/org/apache/forrest/skinconf/SkinconfTransformer.java
Removed:
   forrest/trunk/src/java/org/apache/forrest/skinconf/SkinconfTransformer.java
Modified:
   forrest/trunk/src/core/context/faq.xmap
   forrest/trunk/src/core/context/sitemap.xmap
Log:
Move SkinconfTransformer in the general conf package.

Start putting in an xsl that will try to show broken links for the site: and ext: protocols.

Modified: forrest/trunk/src/core/context/faq.xmap
==============================================================================
--- forrest/trunk/src/core/context/faq.xmap	(original)
+++ forrest/trunk/src/core/context/faq.xmap	Mon Jun 14 00:06:35 2004
@@ -153,6 +153,7 @@
         <map:generate src="cocoon:/{1}{2}.xml"/>
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.html"/>
+        <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
         <map:call resource="skinit">
           <map:parameter name="type" value="document2html"/>
           <map:parameter name="path" value="/{1}{2}.html"/>

Added: forrest/trunk/src/core/context/resources/stylesheets/declare-broken-site-links.xsl
==============================================================================
--- (empty file)
+++ forrest/trunk/src/core/context/resources/stylesheets/declare-broken-site-links.xsl	Mon
Jun 14 00:06:35 2004
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-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">
+
+  <xsl:template match="@*">
+
+    <xsl:attribute name="name(.)">
+      <xsl:choose>
+        <!-- Change the site: and ext: links in the output so that Forrest
+             understands that they are broken -->
+        <xsl:when test="contains(., 'site:') or contains(., 'ext:')">
+          <xsl:value-of select="concat('error:', .)"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:value-of select="."/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+  </xsl:template>
+
+  <xsl:include href="copyover.xsl"/>
+  
+</xsl:stylesheet>
\ No newline at end of file

Modified: forrest/trunk/src/core/context/sitemap.xmap
==============================================================================
--- forrest/trunk/src/core/context/sitemap.xmap	(original)
+++ forrest/trunk/src/core/context/sitemap.xmap	Mon Jun 14 00:06:35 2004
@@ -41,7 +41,7 @@
 
     <map:transformers default="xslt">
       <!-- Add values to skinconf that need extra processing like the color shades -->
-      <map:transformer name="skinconf" src="org.apache.forrest.skinconf.SkinconfTransformer"/>
+      <map:transformer name="skinconf" src="org.apache.forrest.conf.SkinconfTransformer"/>
               
       <!-- Generates @id attributes from <title> strings -->
       <map:transformer name="idgen" src="org.apache.cocoon.transformation.IdGeneratorTransformer">
@@ -331,6 +331,7 @@
             <map:generate src="{project:content.xdocs}{1}{2}.ehtml" />
             <map:transform src="{forrest:stylesheets}/html2htmlbody.xsl" />
             <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html"/>
+            <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
             <map:serialize type="xml" />
           </map:when>
         </map:select>
@@ -343,6 +344,7 @@
         <map:transform type="idgen"/>
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html"/>
+        <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
         <map:call resource="skinit">
           <map:parameter name="type" value="document2html"/>
           <map:parameter name="path" value="{1}{2}.html"/>
@@ -353,6 +355,7 @@
       <map:match pattern="**menu-*.html">
         <map:generate src="cocoon:/{1}book-{2}.html"/>
         <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html"/>
+        <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
         <map:call resource="skinit">
           <map:parameter name="type" value="book2menu"/>
           <map:parameter name="path" value="{1}{2}.html"/>
@@ -425,6 +428,7 @@
         <!-- <map:transform type="idgen"/> -->
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.pdf"/>
+        <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
         <map:select type="exists">
           <map:when test="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
             <map:transform src="{project:skins-dir}{forrest:skin}/xslt/fo/document2fo.xsl">
@@ -456,6 +460,7 @@
         <!-- <map:transform type="idgen"/> -->
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.svg"/>
+        <map:transform src="{forrest:stylesheets}/declare-broken-site-links.xsl" />
         <map:select type="exists">
           <map:when test="{project:skins-dir}{forrest:skin}/xslt/svg/document2svg.xsl">
             <map:transform src="{project:skins-dir}{forrest:skin}/xslt/svg/document2svg.xsl">

Copied: forrest/trunk/src/java/org/apache/forrest/conf/SkinconfTransformer.java (from rev
21189, forrest/trunk/src/java/org/apache/forrest/skinconf/SkinconfTransformer.java)
==============================================================================
--- forrest/trunk/src/java/org/apache/forrest/skinconf/SkinconfTransformer.java	(original)
+++ forrest/trunk/src/java/org/apache/forrest/conf/SkinconfTransformer.java	Mon Jun 14 00:06:35
2004
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.forrest.skinconf;
+package org.apache.forrest.conf;
 
 import java.awt.Color;
 import java.io.IOException;

Mime
View raw message