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/14 13:12:53 UTC

svn commit: r157419 - in forrest/trunk: main/webapp/ main/webapp/skins/leather-dev/templates/ plugins/org.apache.forrest.plugin.fbits/ plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/ plugins/org.apache.forrest.plugin.fbits/resources/templates/ plugins/org.apache.forrest.plugin.fbits/src/documentation/FORREST-INF/ tools/eclipse/

Author: thorsten
Date: Mon Mar 14 04:12:46 2005
New Revision: 157419

URL: http://svn.apache.org/viewcvs?view=rev&rev=157419
Log:
added more templates and changed the default behaviour of the default forrest:view

Added:
    forrest/trunk/main/webapp/skins/leather-dev/templates/
    forrest/trunk/main/webapp/skins/leather-dev/templates/default.fv
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.ft.xsl
Removed:
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.main.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.main.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.main.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.main.ft.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/src/documentation/FORREST-INF/
Modified:
    forrest/trunk/main/webapp/sitemap.xmap
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/forrest.properties
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/output.xmap
    forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/templates/fontsize.ft
    forrest/trunk/tools/eclipse/readme.txt

Modified: forrest/trunk/main/webapp/sitemap.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/sitemap.xmap?view=diff&r1=157418&r2=157419
==============================================================================
--- forrest/trunk/main/webapp/sitemap.xmap (original)
+++ forrest/trunk/main/webapp/sitemap.xmap Mon Mar 14 04:12:46 2005
@@ -477,7 +477,7 @@
     </map:pipeline>
 
     <map:pipeline internal-only="false">
-
+<!--pipeline that "marries" the docs in the root dir with the skin to produce html-->
       <map:match pattern="*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/skinconf.xml"/>
@@ -491,7 +491,7 @@
           <map:parameter name="path" value="{0}"/>
         </map:call>
       </map:match>         
-
+<!--pipeline that "marries" the docs in all other dirs then root with the skin to produce html-->
       <map:match pattern="**/*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/skinconf.xml"/>

Added: forrest/trunk/main/webapp/skins/leather-dev/templates/default.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/leather-dev/templates/default.fv?view=auto&rev=157419
==============================================================================
--- forrest/trunk/main/webapp/skins/leather-dev/templates/default.fv (added)
+++ forrest/trunk/main/webapp/skins/leather-dev/templates/default.fv Mon Mar 14 04:12:46 2005
@@ -0,0 +1,34 @@
+<?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:view
+  xmlns:forrest="http://apache.org/forrest/templates/1.0" type="xhtml">
+  
+  <forrest:contract name="meta"/>
+  
+  <forrest:hook name="content">
+    <forrest:contract name="fontsize"/>
+		<forrest:hook name="export-link">
+      <forrest:contract name="txt-link"/>
+	    <forrest:contract name="xml-link"/>
+		</forrest:hook>
+  </forrest:hook>
+  
+  <forrest:contract name="feedback"/>
+  
+</forrest:view>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/forrest.properties
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/forrest.properties?view=diff&r1=157418&r2=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/forrest.properties (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/forrest.properties Mon Mar 14 04:12:46 2005
@@ -45,9 +45,9 @@
 # project.content-dir if any other property using it is uncommented
 
 #project.status=status.xml
-#project.content-dir=src/documentation
+project.content-dir=src/documentation
 #project.raw-content-dir=${project.content-dir}/content
-#project.conf-dir=${project.content-dir}/conf
+project.conf-dir=${project.content-dir}/FORREST-INF
 #project.sitemap-dir=${project.content-dir}
 #project.xdocs-dir=${project.content-dir}/content/xdocs
 #project.resources-dir=${project.content-dir}/resources

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/output.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/output.xmap?view=diff&r1=157418&r2=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/output.xmap (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/output.xmap Mon Mar 14 04:12:46 2005
@@ -17,6 +17,9 @@
 -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:components>
+		<map:selectors>
+      <map:selector logger="sitemap.selector.exists" name="exists" src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+    </map:selectors>
     <map:generators default="file">
       <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" />
       <map:generator label="content" logger="sitemap.generator.jx" name="jx" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.JXTemplateGenerator"/>
@@ -51,14 +54,39 @@
      <map:serialize type="xml"/>
    </map:match>
   </map:pipeline>
+
+  <map:pipeline>
+    <map:match pattern="prepare.view.*">
+      <map:select type="exists">
+        <!--here we will have to test, whether the requested page needs a specific view.
+          This will be assumed as soon there is a .ft 
+          e.g. index.xml + index.fv-->
+        <map:when test="{project:content.xdocs}{1}.fv">
+          <map:generate src="{project:content.xdocs}{1}.fv"/>
+        </map:when>
+<!--This should be match to the conf dir but I do not know ¿how?
+          {project:conf-dir} does not work -> ask on ml!
+          For now that matches the default.fv in the xdocs dir.
+          The problem with this solution is that the a default.xml will be always render with the default view.
+          Not too bad of a problem after all ;-)-->
+        <map:when test="{project:content.xdocs}/default.fv">
+          <map:generate src="{project:content.xdocs}/default.fv"/>
+        </map:when>
+        <!--If the above not matches then get the default view of the skin-->
+        <map:otherwise>
+          <map:generate src="{forrest:skins-dir}{forrest:skin}/templates/default.fv"/>
+        </map:otherwise>
+      </map:select>
+     	<map:serialize type="xml"/>
+    </map:match>
+  </map:pipeline>
+
   
-  <!--NOTE: The following pipelines are e.g. main.ft -> should be * for document specific output-->
-  
-<!--Aggregate the contract-templates requested by the main.ft for the xsl:include-->
+<!--Aggregate the contract-templates requested by the e.g. default.fv for the xsl:include-->
   <map:pipeline>
-    <map:match pattern="prepare.include.main">
-      <map:generate src="src/documentation/FORREST-INF/main.ft"/>
-      <map:transform src="resources/stylesheets/templates/prepare.include.main.xsl">
+    <map:match pattern="prepare.include.*">
+      <map:generate src="cocoon:/prepare.view.{1}"/>
+      <map:transform src="resources/stylesheets/templates/prepare.include.xsl">
 	      <map:parameter name="config-file" value="{project:skinconf}"/>
       </map:transform>
       <map:transform type="xinclude"/> 
@@ -67,37 +95,40 @@
   </map:pipeline>
 <!--Aggregate the forrest:properties requested by the main.ft-->
   <map:pipeline>
-    <map:match pattern="prepare.meta.main">
-      <map:generate src="src/documentation/FORREST-INF/main.ft"/>
-      <map:transform src="resources/stylesheets/templates/prepare.meta.main.xsl"/>
+    <map:match pattern="prepare.meta.*">
+      <map:generate src="cocoon:/prepare.view.{1}"/>
+      <map:transform src="resources/stylesheets/templates/prepare.meta.xsl"/>
       <map:transform type="xinclude"/> 
      	<map:serialize type="xml"/>
     </map:match>
   </map:pipeline>
   
- <!--Aggregate all contracts-templates requested by the main.ft
+ <!--Aggregate all contracts-templates requested by the view
   getHead - will parse the xhtml head output
   getBody - will parse the xhtml body output 
   --> 
   <map:pipeline>
-    <map:match pattern="prepare.xhtml.main">
+    <map:match pattern="prepare.xhtml.*">
       <map:aggregate element="forrest:filter">
-        <map:part src="src/documentation/FORREST-INF/main.ft" />
-        <map:part src="cocoon:/prepare.meta.main" /> 
+        <map:part src="cocoon:/prepare.view.{1}" />
+        <map:part src="cocoon:/prepare.meta.{1}" /> 
       </map:aggregate>
-      <map:transform src="resources/stylesheets/templates/prepare.xhtml.main.xsl" >
-      </map:transform>
+      <map:transform src="resources/stylesheets/templates/prepare.xhtml.xsl" />
      	<map:serialize type="xml"/>
     </map:match>
   </map:pipeline>
   <!--Outputs xhtml of the main.ft-->
   <map:pipeline>
-    <map:match pattern="transform.ft">
+    <map:match pattern="transform.*">
       <map:aggregate element="forrest:filter">
-        <map:part src="src/documentation/FORREST-INF/main.ft" />
-        <map:part src="cocoon:/prepare.meta.main" /> 
+        <map:part src="cocoon:/prepare.view.{1}" />
+        <map:part src="cocoon:/prepare.meta.{1}" /> 
       </map:aggregate>
-      <map:transform src="resources/stylesheets/templates/transform.main.ft.xsl" >
+      <map:transform src="resources/stylesheets/templates/prepare.include.xhtml.xsl" >
+        <map:parameter name="request" value="{1}"/>
+      </map:transform>
+     	<map:serialize type="xml"/>
+      <map:transform src="resources/stylesheets/templates/transform.ft.xsl" >
         <map:parameter name="path" value="{path}"/>
         <map:parameter name="config-file" value="{project:skinconf}"/>
       </map:transform>

Added: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.xsl?view=auto&rev=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.xsl (added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.include.xsl Mon Mar 14 04:12:46 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"  
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias">
+    <xsl:namespace-alias 
+         stylesheet-prefix="alias" result-prefix="xsl"/>
+
+  <xsl:template match="/">
+    <alias:stylesheet version="1.0">
+	    <xsl:for-each select="forrest:view//forrest:contract">
+	      <xi:include href="cocoon:/get.contract.{@name}.xhtml"/>
+	    </xsl:for-each>
+    </alias:stylesheet>
+  </xsl:template>
+
+</xsl:stylesheet>

Added: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.xsl?view=auto&rev=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.xsl (added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.meta.xsl Mon Mar 14 04:12:46 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"  
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  >
+
+
+  <xsl:template match="/">
+    <forrest:properties >
+	    <xsl:for-each select="forrest:view//forrest:contract">
+	      <xi:include href="cocoon:/get.contract-meta.{@name}"/>
+	    </xsl:for-each>
+    </forrest:properties>
+  </xsl:template>
+  
+</xsl:stylesheet>

Added: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.xsl?view=auto&rev=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.xsl (added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/prepare.xhtml.xsl Mon Mar 14 04:12:46 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"  
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias"
+  >
+  <xsl:namespace-alias stylesheet-prefix="alias" result-prefix="xsl"/>
+  
+  <xsl:template match="/">
+    <alias:stylesheet version="1.0">
+      <xsl:comment>All xhtml head elements requested by the forrest:template</xsl:comment>
+			<alias:template name="getHead">
+			  <xsl:for-each select="/*/forrest:properties/*[@head='true']">
+		      <alias:call-template name="{@name}-head" />
+			  </xsl:for-each>
+		   </alias:template>
+		   
+      <xsl:comment>All xhtml body elements requested by the forrest:template</xsl:comment>
+			<alias:template name="getBody">
+          <xsl:apply-templates select="/*/forrest:view"/>
+		   </alias:template>
+		</alias:stylesheet>
+	</xsl:template>
+	
+  <xsl:template match="forrest:view">
+    <xsl:apply-templates/>
+  </xsl:template>
+	
+	<xsl:template match="forrest:hook">
+    <div id="{@name}">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="forrest:contract">
+    <xsl:variable name="name" select="@name"/>
+    <!--Test whether there is a body template needed-->
+    <xsl:if test="/*/forrest:properties/*[@body='true' and @name=$name]">
+	    <alias:call-template name="{@name}-body" />
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>

Added: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.ft.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.ft.xsl?view=auto&rev=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.ft.xsl (added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/stylesheets/templates/transform.ft.xsl Mon Mar 14 04:12:46 2005
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"  
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias"
+  xmlns:saxon="http://saxon.sf.net/"
+  extension-element-prefixes="saxon"
+  >
+  
+  <xsl:namespace-alias stylesheet-prefix="alias" result-prefix="xsl"/>
+  <!--FIXME: ¡¡¡Need to make sure all variables are matched!!!-->
+ 	<xsl:param name="config-file"/>
+  <xsl:param name="path"/>
+  <xsl:variable name="config" select="document($config-file)/skinconfig"/>
+  
+	<!--<xsl:include href="cocoon:/prepare.include.{$request}"/>
+  <xsl:include href="cocoon:/prepare.xhtml.{$request}"/>-->
+
+  <xsl:template match="/">
+    <html>
+      <head>
+    		<xsl:call-template name="getHead"/>
+      </head>
+      <body onload="init()">
+        <h1><xsl:value-of select="$request"/> </h1>
+        <xsl:call-template name="getBody"/>
+      </body>
+    </html>
+  </xsl:template>
+
+</xsl:stylesheet>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/templates/fontsize.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/templates/fontsize.ft?view=diff&r1=157418&r2=157419
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/templates/fontsize.ft (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.fbits/resources/templates/fontsize.ft Mon Mar 14 04:12:46 2005
@@ -33,7 +33,7 @@
 			  
 			  <xsl:template name="fontsize-body">
 			      <script type="text/javascript">ndeSetTextSize();</script>
-			      <div class="trail">
+			      <div class="branding-trail">
 			            Font size: 
 			              &#160;<input type="button" onclick="ndeSetTextSize('reset'); return false;" title="Reset text" class="resetfont" value="Reset"/>      
 			              &#160;<input type="button" onclick="ndeSetTextSize('decr'); return false;" title="Shrink text" class="smallerfont" value="-a"/>

Modified: forrest/trunk/tools/eclipse/readme.txt
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/readme.txt?view=diff&r1=157418&r2=157419
==============================================================================
--- forrest/trunk/tools/eclipse/readme.txt (original)
+++ forrest/trunk/tools/eclipse/readme.txt Mon Mar 14 04:12:46 2005
@@ -79,7 +79,8 @@
     - Eclipse Modelling Framework
     - EMF SDK
     - EMF Service Data Objects
-    - Graphical Editing FrameworkXSD Sxhema Infoset Model
+    - Graphical Editing Framework
+    - XSD Sxhema Infoset Model
   - click "Next"
   - accept the license aggreement (after reading it of course)
   - click "Next"



Re: Leather and global variables

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Wed, 2005-03-16 at 08:34 +0000, Ross Gardler wrote:
> 
> 
>>I'm guessing you mean something like:
>>
>><map:generate src="{project:conf-dir}/default.fv"/>
>>
>>If so, my original reply was spot on: Do you mean where do we define 
>>*new* global variables that can be set in forrest.properties?
>>
>>You now need to set the value you want in forrest.properties:
>>
>>project.conf-dir=${project.content-dir}/conf
>>
>>Everything else happens automatically.
>>
> 
> 
> hmm, I actually thought so, but no. 
> 
> I did it like this from the beginning and because it was not working
> like this I asked about defining new variables.
> 
> 
>>If this isn't what you are trying to do then it really would help my 
>>fuzzy early morning brain if you provided a code snippet of what you 
>>want to do - I wouldn't have to think before my morning brew ;-) (my 
>>head hurts this morning - sorry)
> 
> 

...

> <map:when test="{project:conf-dir}/default.fv">
>           <map:generate src="{project:conf-dir}/default.fv"/>
>         </map:when>

Hmmm, so my guesses about what you were doing were right. I'm not sure 
why this isn't working - it should. We are clearly missing something 
(maybe someone will jump in here).

Just a shot in the dark. Have you tried building forrest. I don't see 
that this will make any difference, but then I don't understand the 
magic about how stuff gets from cocoon.xconf into the sitemap. It can't 
do any harm.

What happens when you have the above pipeline instead of your hack. You 
should get an error message in the logs that will indicate what value is 
being assgned to {project:conf-dir} (or not as the case may be).

Ross

Re: Leather and global variables

Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2005-03-16 at 08:34 +0000, Ross Gardler wrote:

> I'm guessing you mean something like:
> 
> <map:generate src="{project:conf-dir}/default.fv"/>
> 
> If so, my original reply was spot on: Do you mean where do we define 
> *new* global variables that can be set in forrest.properties?
> 
> You now need to set the value you want in forrest.properties:
> 
> project.conf-dir=${project.content-dir}/conf
> 
> Everything else happens automatically.
> 

hmm, I actually thought so, but no. 

I did it like this from the beginning and because it was not working
like this I asked about defining new variables.

> If this isn't what you are trying to do then it really would help my 
> fuzzy early morning brain if you provided a code snippet of what you 
> want to do - I wouldn't have to think before my morning brew ;-) (my 
> head hurts this morning - sorry)

The pipe looks like the following right now:

<map:pipeline>
    <map:match pattern="prepare.view.*">
      <map:select type="exists">
        <!--here we will have to test, whether the requested page needs
a specific view.
          This will be assumed as soon there is a .ft 
          e.g. index.xml + index.fv-->
        <map:when test="{project:content.xdocs}{1}.fv">
          <map:generate src="{project:content.xdocs}{1}.fv"/>
        </map:when>
<!--This should be match to the conf dir but I do not know ¿how?
          {project:conf-dir} does not work -> ask on ml!
          For now that matches the default.fv in the xdocs dir.
          The problem with this solution is that the a default.xml will
be always render with the default view.
          Not too bad of a problem after all ;-)-->
        <map:when test="{project:content.xdocs}/default.fv">
          <map:generate src="{project:content.xdocs}/default.fv"/>
        </map:when>
        <!--If the above not matches then get the default view of the
skin-->
        <map:otherwise>
          <map:generate
src="{forrest:skins-dir}{forrest:skin}/templates/default.fv"/>
        </map:otherwise>
      </map:select>
     <map:serialize type="xml"/>
    </map:match>
  </map:pipeline>

But it should be like this:
<map:when test="{project:conf-dir}/default.fv">
          <map:generate src="{project:conf-dir}/default.fv"/>
        </map:when>

TIA for your time (again)

salu2
thorsten

> 
> Ross
> 
> 
> 
> 
> 
> 
> 
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Leather and global variables

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Tue, 2005-03-15 at 10:08 +0000, Ross Gardler wrote:
> 
>>Thorsten Scherler wrote:
>>
>>>On Mon, 2005-03-14 at 12:12 +0000, thorsten@apache.org wrote:
>>>
>>>I need some input on the following:
>>>
>>>
>>>
>>>>+<!--This should be match to the conf dir but I do not know ¿how?
>>>>+          {project:conf-dir} does not work -> ask on ml!
>>>>+          For now that matches the default.fv in the xdocs dir.
>>>>+          The problem with this solution is that the a default.xml will be always render with the default view.
>>>>+          Not too bad of a problem after all ;-)-->
>>>
>>>
>>>Where do we define this global variables? 
>>
>>Do you mean where do we define *new* global variables that can be set in 
>>forrest.properties? If so the answer is cocoon.xconf.
>>
> 
> 
> hmm, ok, I tried:
> Index: main/webapp/WEB-INF/xconf/forrest-core.xconf
> ===================================================================
> --- main/webapp/WEB-INF/xconf/forrest-core.xconf        (revision
> 157530)
> +++ main/webapp/WEB-INF/xconf/forrest-core.xconf        (working copy)
> @@ -139,6 +139,7 @@
>          <doc>@project.home@/@project.content-dir@/</doc>
>          <content>@project.home@/@project.raw-content-dir@/</content>
> 
> <content.xdocs>@project.home@/@project.xdocs-dir@/</content.xdocs>
> +        <conf-dir>@project.conf-dir@</conf-dir>
> 
> <translations>@project.home@/@project.translations-dir@</translations>
> <resources.stylesheets>@project.home@/@project.stylesheets-dir@/</resources.stylesheets>
> 
> <resources.images>@project.home@/@project.images-dir@/</resources.images>
> 
> ...but I could not find any target that would do e.g.
> <replacetoken>@project.home@</replacetoken>
> 
> Can you please give me another hint how to use {project:conf-dir} within
> my output.xmap

I'm guessing you mean something like:

<map:generate src="{project:conf-dir}/default.fv"/>

If so, my original reply was spot on: Do you mean where do we define 
*new* global variables that can be set in forrest.properties?

You now need to set the value you want in forrest.properties:

project.conf-dir=${project.content-dir}/conf

Everything else happens automatically.

If this isn't what you are trying to do then it really would help my 
fuzzy early morning brain if you provided a code snippet of what you 
want to do - I wouldn't have to think before my morning brew ;-) (my 
head hurts this morning - sorry)

Ross









Re: Leather and global variables

Posted by Thorsten Scherler <th...@apache.org>.
On Tue, 2005-03-15 at 10:08 +0000, Ross Gardler wrote:
> Thorsten Scherler wrote:
> > On Mon, 2005-03-14 at 12:12 +0000, thorsten@apache.org wrote:
> > 
> > I need some input on the following:
> > 
> > 
> >>+<!--This should be match to the conf dir but I do not know ¿how?
> >>+          {project:conf-dir} does not work -> ask on ml!
> >>+          For now that matches the default.fv in the xdocs dir.
> >>+          The problem with this solution is that the a default.xml will be always render with the default view.
> >>+          Not too bad of a problem after all ;-)-->
> > 
> > 
> > Where do we define this global variables? 
> 
> Do you mean where do we define *new* global variables that can be set in 
> forrest.properties? If so the answer is cocoon.xconf.
> 

hmm, ok, I tried:
Index: main/webapp/WEB-INF/xconf/forrest-core.xconf
===================================================================
--- main/webapp/WEB-INF/xconf/forrest-core.xconf        (revision
157530)
+++ main/webapp/WEB-INF/xconf/forrest-core.xconf        (working copy)
@@ -139,6 +139,7 @@
         <doc>@project.home@/@project.content-dir@/</doc>
         <content>@project.home@/@project.raw-content-dir@/</content>

<content.xdocs>@project.home@/@project.xdocs-dir@/</content.xdocs>
+        <conf-dir>@project.conf-dir@</conf-dir>

<translations>@project.home@/@project.translations-dir@</translations>
<resources.stylesheets>@project.home@/@project.stylesheets-dir@/</resources.stylesheets>

<resources.images>@project.home@/@project.images-dir@/</resources.images>

...but I could not find any target that would do e.g.
<replacetoken>@project.home@</replacetoken>

Can you please give me another hint how to use {project:conf-dir} within
my output.xmap


> > Now to the changes of the fbits-plugin in regards to leather.
> 
> I'll have a look at that as soon as I can, should be in a day or two.
> 
> > 
> > The missing steps are just a matter of implementing (change the default
> > "skinit" pipe and capsuled all code of the site2xhtml.xsl). I am working
> > on that (including document2xhtml and css) right now but I am "scared"
> > to commit it (because I do not have the time to test it appropriately
> > and it will alter the default behavior of forrest), so I will prepare a
> > patch or open a new branch (what do you prefer?) for the upcoming
> > changes.
> 
> We definitely *don't* want to go messing with core before the 0.7 release.
> 

That is why I said if I will touch the core I will prepare a patch or
will create a new branch. ;-)

> Have you considered using an internal plugin? You can (theoretically) 
> override anything in the core sitemaps using an internal plugin. This 
> sounds like a brilliant use case for complete testing of internal 
> plugins (only the IMSManifest plugin exists so far).
> 

Yeah, I will try that.

> Working with it as an Internal plugin will prevent any branch merge 
> conflicts at a later date. Of course we will still be able to move it 
> into core if and when necessary.
> 

ok, I will try the internal plugin ASAP.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Leather and global variables

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Mon, 2005-03-14 at 12:12 +0000, thorsten@apache.org wrote:
> 
> I need some input on the following:
> 
> 
>>+<!--This should be match to the conf dir but I do not know ¿how?
>>+          {project:conf-dir} does not work -> ask on ml!
>>+          For now that matches the default.fv in the xdocs dir.
>>+          The problem with this solution is that the a default.xml will be always render with the default view.
>>+          Not too bad of a problem after all ;-)-->
> 
> 
> Where do we define this global variables? 

Do you mean where do we define *new* global variables that can be set in 
forrest.properties? If so the answer is cocoon.xconf.

> Now to the changes of the fbits-plugin in regards to leather.

I'll have a look at that as soon as I can, should be in a day or two.

> 
> The missing steps are just a matter of implementing (change the default
> "skinit" pipe and capsuled all code of the site2xhtml.xsl). I am working
> on that (including document2xhtml and css) right now but I am "scared"
> to commit it (because I do not have the time to test it appropriately
> and it will alter the default behavior of forrest), so I will prepare a
> patch or open a new branch (what do you prefer?) for the upcoming
> changes.

We definitely *don't* want to go messing with core before the 0.7 release.

Have you considered using an internal plugin? You can (theoretically) 
override anything in the core sitemaps using an internal plugin. This 
sounds like a brilliant use case for complete testing of internal 
plugins (only the IMSManifest plugin exists so far).

Working with it as an Internal plugin will prevent any branch merge 
conflicts at a later date. Of course we will still be able to move it 
into core if and when necessary.

> ...but saying this an old question in my head raises. IMO skins are not
> flexible enough to met user needs. Their should become deprecated when
> the forrest:views are finally working in the way the old skins did. 

Lets see what we think when forrest:views are done. My view is that if 
they can do everything skins can *and* they add flexibility then we 
should deprecate skins for them. What I see so far indicates this to be 
the case, but not yet.

> Now I am facing a mayor clean up of the fbits plugin because 90% of the
> stuff is not needed anymore. I kept it simple and stupid (regards 2
> Ross) and ended up with a couple of pipes and stylesheets.

Glad to hear much of it is not needed, I've been trying to follow your 
work and am afraid to admit I am still confused. Now I know why.

> I further think that the fbits plugin should be either called
> forrest.contracts or forrest.view plugin because actually it is a
> producing factory which will deliver contracts (fbits or nuggets) for a
> forrest:view. 

forrest.view seems more descriptive.

> Wrapping up here my upcoming steps:
> 1) implement css
> 2) implement requested document parsing
> 3) cleanup and rename fbits.plugin

When I have the time I will see if I can do what I need to do and 
provide some feedback (and hopefully assistance).

Looks like great work.

> ATM I am working on a client project away from home and have limited
> internet access, please be patient waiting for my answer. 

pesky clients!

Ross



Leather and global variables (was: Re: svn commit: r157419)

Posted by Thorsten Scherler <th...@apache.org>.
On Mon, 2005-03-14 at 12:12 +0000, thorsten@apache.org wrote:

I need some input on the following:

> +<!--This should be match to the conf dir but I do not know ¿how?
> +          {project:conf-dir} does not work -> ask on ml!
> +          For now that matches the default.fv in the xdocs dir.
> +          The problem with this solution is that the a default.xml will be always render with the default view.
> +          Not too bad of a problem after all ;-)-->

Where do we define this global variables? 

Now to the changes of the fbits-plugin in regards to leather.

If you build a project, choose leather as default skin and add the fbits
plugin to your props then you get some of the implemented fbits as xhtml
(the only format I have implemented so far) via
http://localhost:8888/get.contract.{contractName}.{format}
one example would be http://localhost:8888/get.contract.feedback.xhtml

I activated the default view  (default.fv) in the leather skin. This
means the generation of xhtml pages via a forrest:view is now possible
in leather skin (or all other project that have a default.fv in their
root xdocs dir). If you meet the above mentioned requirements then try
http://localhost:8888/transform.default

In leather you will find {leather}/templates/default.fv
<forrest:view
  xmlns:forrest="http://apache.org/forrest/templates/1.0" type="xhtml">
  
  <forrest:contract name="meta"/>
  
  <forrest:hook name="content">
    <forrest:contract name="fontsize"/>
		<forrest:hook name="export-link">
      <forrest:contract name="txt-link"/>
	    <forrest:contract name="xml-link"/>
		</forrest:hook>
  </forrest:hook>
  
  <forrest:contract name="feedback"/>
  
</forrest:view>

So far I did not included any css information nor did I include the
actual page in the output. Further this template is JUST a testing
template. 

The missing steps are just a matter of implementing (change the default
"skinit" pipe and capsuled all code of the site2xhtml.xsl). I am working
on that (including document2xhtml and css) right now but I am "scared"
to commit it (because I do not have the time to test it appropriately
and it will alter the default behavior of forrest), so I will prepare a
patch or open a new branch (what do you prefer?) for the upcoming
changes.

...but saying this an old question in my head raises. IMO skins are not
flexible enough to met user needs. Their should become deprecated when
the forrest:views are finally working in the way the old skins did. 

Now I am facing a mayor clean up of the fbits plugin because 90% of the
stuff is not needed anymore. I kept it simple and stupid (regards 2
Ross) and ended up with a couple of pipes and stylesheets.

I further think that the fbits plugin should be either called
forrest.contracts or forrest.view plugin because actually it is a
producing factory which will deliver contracts (fbits or nuggets) for a
forrest:view. 

It is now limited (by name) to fbits but should be extended for nuggets
as well (like I said in other mails before, in html the distinction
between nuggets and fbits do not make much sense yet. They are
forrest:contracts, in other format like inx the distinction is
necessary). Further the resulting plugin have to become internal and
default (when deprecating skins).

Wrapping up here my upcoming steps:
1) implement css
2) implement requested document parsing
3) cleanup and rename fbits.plugin

ATM I am working on a client project away from home and have limited
internet access, please be patient waiting for my answer. 

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)