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/03/26 05:32:40 UTC

svn commit: r159093 - in forrest/trunk/plugins/org.apache.forrest.plugin.views: ./ resources/stylesheets/ resources/templates/ src/documentation/ src/documentation/classes/ src/documentation/content/xdocs/ src/documentation/content/xdocs/images/

Author: thorsten
Date: Fri Mar 25 20:32:38 2005
New Revision: 159093

URL: http://svn.apache.org/viewcvs?view=rev&rev=159093
Log:
example for a dynamic contract reading from the view properties.

Added:
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl   (contents, props changed)
      - copied, changed from r159043, forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.meta.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft   (with props)
Removed:
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.meta.xsl
Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.views/build.xml   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/forrest.properties   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap   (contents, props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/contract.property.xsl   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/contract.xsl   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.include.xsl   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl   (contents, props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/content.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/fontsize.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/grouplogo.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/meta.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav-main-sub.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav-main.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/noFt.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/pdf-link.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/pod-link.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/projectlogo.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/searchbox.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/txt-link.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/xml-link.ft   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/classes/CatalogManager.properties   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/images/group.svg   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/images/project.svg   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/index.xml   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/site.xml   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/tabs.xml   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/skinconf.xml   (props changed)
    forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml   (contents, props changed)

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/forrest.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap?view=diff&r1=159092&r2=159093
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap Fri Mar 25 20:32:38 2005
@@ -110,7 +110,7 @@
   Get the forrest:properties of the requested contract. 
   This will determine which templates (css, head, body) we have to call later on
   -->
-   <map:match pattern="get.contract-meta.*">
+   <map:match pattern="get.contract-property.*">
      <map:generate src="cocoon:/resolve.contract.{1}"/>
      <map:transform src="resources/stylesheets/contract.property.xsl"/>
      <map:serialize type="xml"/>
@@ -153,9 +153,10 @@
 				<map:aggregate element="site">
           <map:part src="cocoon://skinconf.xml"/>
           <map:part src="cocoon://build-info"/>
-          <map:part src="cocoon://tab-{1}"/>
-          <map:part src="cocoon://menu-{1}"/>
-          <map:part src="cocoon://body-{1}"/>
+          <map:part src="cocoon://tab-{1}.html"/>
+          <map:part src="cocoon://menu-{1}.html"/>
+          <map:part src="cocoon://body-{1}.html"/>
+          <map:part src="cocoon:/prepare.view.{1}"/>
         </map:aggregate>
         <map:serialize type="xml"/>
     </map:match>
@@ -216,9 +217,9 @@
       Aggregate the forrest:properties requested by the *.fv.
       The result is an aggregation of properties which defines the templates to be call.
       -->
-    <map:match pattern="prepare.meta.*">
+    <map:match pattern="prepare.properties.*">
       <map:generate src="cocoon:/prepare.view.{1}"/>
-      <map:transform src="resources/stylesheets/prepare.meta.xsl"/>
+      <map:transform src="resources/stylesheets/prepare.properties.xsl"/>
       <map:transform type="xinclude"/> 
      	<map:serialize type="xml"/>
     </map:match>
@@ -229,7 +230,7 @@
     <map:match pattern="prepare.xhtml.*">
       <map:aggregate element="forrest:filter">
         <map:part src="cocoon:/prepare.view.{1}" />
-        <map:part src="cocoon:/prepare.meta.{1}" /> 
+        <map:part src="cocoon:/prepare.properties.{1}" /> 
       </map:aggregate>
       <map:transform src="resources/stylesheets/prepare.xhtml.xsl" >
         <map:parameter name="request" value="{1}"/>
@@ -242,7 +243,7 @@
   Here we are overriding the default skin generation.
   -->   
     <map:match pattern="*.html">
-      <map:generate src="cocoon:/{0}.page"/>
+      <map:generate src="cocoon:/{1}.page"/>
       <map:transform src="cocoon:/prepare.xhtml.{1}"/>
      	<map:serialize type="xhtml"/>
     </map:match>

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/output.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/contract.property.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/contract.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.include.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl (from r159043, forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.meta.xsl)
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl?view=diff&rev=159093&p1=forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.meta.xsl&r1=159043&p2=forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl&r2=159093
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.meta.xsl (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl Fri Mar 25 20:32:38 2005
@@ -26,7 +26,7 @@
   <xsl:template match="/">
     <forrest:properties >
 	    <xsl:for-each select="forrest:view//forrest:contract">
-	      <xi:include href="cocoon:/get.contract-meta.{@name}"/>
+	      <xi:include href="cocoon:/get.contract-property.{@name}"/>
 	    </xsl:for-each>
     </forrest:properties>
   </xsl:template>

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.properties.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl?view=diff&r1=159092&r2=159093
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl Fri Mar 25 20:32:38 2005
@@ -77,6 +77,7 @@
 			 <alias:template name="getBody">
           <xsl:apply-templates select="/*/forrest:view"/>
 		   </alias:template>
+       
        <alias:template match="site">
         <xhtml>
       		<head>
@@ -209,10 +210,23 @@
   
   <xsl:template match="forrest:contract">
     <xsl:variable name="name" select="@name"/>
-	    <xsl:apply-templates/>
+    
     <!--Test whether there is a body template needed-->
     <xsl:if test="/*/forrest:properties/*[@body='true' and @name=$name]">
-	    <alias:call-template name="{@name}-body" />
+      <!--If next son is not forrest:properties go on-->
+      <xsl:choose>
+        <xsl:when test="not(forrest:properties[@contract=$name])">
+          <xsl:apply-templates/>
+          <alias:call-template name="{@name}-body" />
+        </xsl:when>
+        <xsl:when test="forrest:properties[@contract=$name]">
+          <alias:call-template name="{@name}-body" >
+          <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
+            <alias:with-param name="{@name}" select=".//forrest:properties[@contract='{$name}']/forrest:property[@name='{@name}']" />
+          </xsl:for-each>
+          </alias:call-template>
+        </xsl:when>
+      </xsl:choose>
     </xsl:if>
   </xsl:template>
 

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/stylesheets/prepare.xhtml.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/content.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft?view=auto&rev=159093
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft (added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft Fri Mar 25 20:32:38 2005
@@ -0,0 +1,67 @@
+<?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="feedback-dyn" type="nugget"
+  xmlns:forrest="http://apache.org/forrest/templates/1.0">
+  <description>
+    This function will output the html feedback-dyn information.
+  </description>
+
+  <forrest:template
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  format="xhtml" name="feedback-dyn" inputFormat="xsl" body="true" head="false" css="true">
+
+      <xsl:stylesheet version="1.1" 
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+        
+        <xsl:template name="feedback-dyn-css">
+#feedback {
+    color: black;
+    background: #CFDCED;
+    text-align:center;
+    margin-top: 5px;
+}
+#feedback #feedbackto {
+    font-size: 90%;
+    color: black;
+}</xsl:template>
+        
+	    <xsl:template name="feedback-dyn-body">
+	        <xsl:param name="main"/>
+		    <div id="feedback"> 
+		      <xsl:value-of select="$main/feedback"/>
+		      <xsl:choose>
+		        <xsl:when test="$main/feedback/@href and not($main/feedback/@href='')">
+		          <a id="feedbackto">
+		            <xsl:attribute name="href">
+		              <xsl:value-of select="$main/feedback/@href"/>
+		              <xsl:value-of select="$path"/>
+		            </xsl:attribute>
+		            <xsl:value-of select="$main/feedback/@to"/>
+		          </a>
+		        </xsl:when>
+		        <xsl:otherwise>
+		          <xsl:value-of select="$config/feedback/@to"/>
+		        </xsl:otherwise>
+		      </xsl:choose>
+		    </div>
+			</xsl:template>
+    </xsl:stylesheet>
+	</forrest:template>
+</forrest:contract>
\ No newline at end of file

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback-dyn.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feedback.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/fontsize.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/grouplogo.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/meta.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav-main-sub.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav-main.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/nav.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/noFt.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/pdf-link.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/pod-link.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/projectlogo.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/searchbox.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/txt-link.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/xml-link.ft
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/classes/CatalogManager.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/images/group.svg
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/images/project.svg
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/index.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/content/xdocs/tabs.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/skinconf.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml?view=diff&r1=159092&r2=159093
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml Fri Mar 25 20:32:38 2005
@@ -25,7 +25,7 @@
   <changes>
     <!-- Add new releases here -->
     <release version="0.1" date="unreleased">
-      <action dev="RDG" type="add" context="admin">
+      <action dev="TS" type="add" context="admin">
         Initial plugin code.
       </action>
     </release>
@@ -41,6 +41,9 @@
         Create the documentation with lots of examples and samples.  
         XML content goes in
         <code>src/documentation/content/xdocs</code>.
+      </action>
+      <action context="core" dev="open">
+        make all pipeline format dependend (pass param fomat) to activate other format as well rather then xhtml implementations
       </action>
     </actions>
   </todo>

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.views/status.xml
------------------------------------------------------------------------------
    svn:eol-style = native