forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r499365 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft
Date Wed, 24 Jan 2007 11:32:18 GMT
Author: thorsten
Date: Wed Jan 24 03:32:11 2007
New Revision: 499365

URL: http://svn.apache.org/viewvc?view=rev&rev=499365
Log:
Adding contract to easily generate Apache httpd server side includes.

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft?view=auto&rev=499365
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft
(added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/apache-ssi.ft
Wed Jan 24 03:32:11 2007
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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 
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  name="apache-ssi">
+  
+  <description>
+    apache-ssi will output a ssi include link for the Apache webserver.
+    You can either use "virtual" or "file" includes. Will output something like:
+    <![CDATA[<!--#include virtual="file.html" -->]]>
+  </description>
+  <usage><![CDATA[<forrest:contract name="apache-ssi">
+  <forrest:property name="includeType">virtual|file</forrest:property>
+  <forrest:property name="includePath">index.html</forrest:property>
+</forrest:contract>]]></usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="apache-ssi" inputFormat="xsl">
+    <xsl:stylesheet version="1.1" 
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+		<xsl:param name="includeType" select="'virtual|file'"/>
+		<xsl:param name="includePath" select="'../index.html'"/>
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part>
+            <xsl:variable name="output"> #include
+              <xsl:choose>
+                <xsl:when test="$includeType='virtual'">
+                  virtual="
+                  <xsl:value-of select="$includePath"/>"
+                  </xsl:when>
+                <xsl:otherwise> file="
+                  <xsl:value-of select="$includePath"/>"
+                  </xsl:otherwise>
+              </xsl:choose> </xsl:variable>
+            <xsl:comment>
+              <xsl:value-of
+                select="normalize-space($output)"/>
+            </xsl:comment>
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>
\ No newline at end of file



Mime
View raw message