forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r167914 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs
Date Tue, 03 May 2005 14:54:45 GMT
Author: thorsten
Date: Tue May  3 07:54:43 2005
New Revision: 167914

URL: http://svn.apache.org/viewcvs?rev=167914&view=rev
Log:
various changes and bugfixes that I noted when I developed another format implementation of
the viewHelper. Diwaker Gupta noticed that I used xhtml instead of html as tag. The templates
are only allowed to be imported once when 2 or more times the same contract got used. Added
explanation about * matches. Renamed prepare.*.** (which prepared the final stylesheet to
be used) to getStylesheet to make it more self explaning.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.css.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.include.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.properties.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs/howItWork.xml
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/output.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs/index.xml

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
Tue May  3 07:54:43 2005
@@ -116,6 +116,7 @@
       <map:transform type="xinclude"/>
      	<map:serialize type="xml"/>
     </map:match>
+    
 <!--
   Aggregate the contract-templates requested by the view with xinclude.
   The result is a stylesheet with all needed xsl:templates.
@@ -144,11 +145,16 @@
       <map:transform type="xinclude"/> 
      	<map:serialize type="xml"/>
     </map:match>
+    <!--FIXME
+      This has to be an interface and not an implementation
+      
+      An interface will only generate cocoon protocol matches and serialize them!
+      An implementation will deliver the actual match (including transformation)-->
     <!--
       Aggregate all contracts-templates requested by the view.
       Create a xsl that can be used for the last step of the transformation of the view.
   		--> 
-    <map:match pattern="prepare.*.**">
+    <map:match pattern="getStylesheet.*.**">
       <map:aggregate element="forrest:filter">
         <map:part src="cocoon://prepare.view.{2}" />
         <map:part src="cocoon://prepare.properties.{1}.{2}" /> 
@@ -175,7 +181,7 @@
   
   <!--
   2. businessHelper
-  This is the content producing factory.
+  This is the model producing factory.
   -->
 <!--NOTE: 
   The current factory uses the models the skin (e.g. document2xhtml.xsl from pelt [default
skin]).

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.css.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.css.xsl?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.css.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.css.xsl
Tue May  3 07:54:43 2005
@@ -22,11 +22,15 @@
   xmlns:forrest="http://apache.org/forrest/templates/1.0" 
   >
   
+  <xsl:key name="contract-name" match="forrest:properties" use="@name" />
+  
   <xsl:template match="/">
-		  <xsl:for-each select="//forrest:properties/*[@css='true']">
-	      <xi:include href="cocoon://get.contract-css.{@name}" />
-		  </xsl:for-each>
-      <xsl:apply-templates select="//extra-css"/>
+    <xsl:for-each 
+      select="//forrest:properties/*[count(. | key('contract-name', @name)[1]) = 1 and @css='true']">
+      <xsl:sort select="@name" />
+      <xi:include href="cocoon://get.contract-css.{@name}" />
+    </xsl:for-each>
+    <xsl:apply-templates select="//extra-css"/>
   </xsl:template>
   <xsl:template match="extra-css">
     <xsl:value-of select="."/>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.include.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.include.xsl?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.include.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.include.xsl
Tue May  3 07:54:43 2005
@@ -29,10 +29,13 @@
   
   <xsl:template match="/">
     <alias:stylesheet version="1.0">
+      <!--NOTE:
+        contracts are allowed only to be importet once! Thx to
+        http://www.jenitennison.com/xslt/grouping/muenchian.html-->
       <xsl:for-each 
         select="forrest:views/forrest:view[@type=$format]//forrest:contract[count(. | key('contract-name',
@name)[1]) = 1]">
         <xsl:sort select="@name" />
-        <xi:include href="cocoon://get.contract.{$format}.{@name}"/>
+        <xi:include href="cocoon://get.contract.{@name}.{$format}"/>
       </xsl:for-each>
     </alias:stylesheet>
   </xsl:template>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.properties.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.properties.xsl?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.properties.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.properties.xsl
Tue May  3 07:54:43 2005
@@ -27,7 +27,7 @@
   <xsl:template match="/">
     <forrest:properties >
 	    <xsl:for-each select="forrest:views/forrest:view[@type=$format]//forrest:contract">
-	      <xi:include href="cocoon://get.contract-property.{$format}.{@name}"/>
+	      <xi:include href="cocoon://get.contract-property.{@name}.{$format}"/>
 	    </xsl:for-each>
     </forrest:properties>
   </xsl:template>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
Tue May  3 07:54:43 2005
@@ -40,7 +40,7 @@
             </alias:template>
         	<!--default entry point into the presentation model 'site'-->
             <alias:template match="site">
-                <xhtml>
+                <html>
                     <head>
                         <alias:call-template name="getHead"/>
                     	<!--Test whether there is an own css implemention requested by the
view-->
@@ -67,7 +67,7 @@
                     <body onload="init()">
                         <alias:call-template name="getBody"/>
                     </body>
-                </xhtml>
+                </html>
             </alias:template>
         </alias:stylesheet>
     </xsl:template>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs/howItWork.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs/howItWork.xml?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs/howItWork.xml
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/src/documentation/content/xdocs/howItWork.xml
Tue May  3 07:54:43 2005
@@ -34,7 +34,7 @@
 1. viewHelper
   This is the template producing factory.
 
-a. <![CDATA[<map:match pattern="resolve.contract.*">]]> -> Resolving factory
+a. <![CDATA[<map:match pattern="resolve.contract.*.*">]]> -> Resolving factory
 Project implementation of templates have priority before default ones.
 If no implementation can be found we use the noFt (~ - no
 forrest:template) implementation.-> this match is implemented in the viewHelper plugin

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/output.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/output.xmap?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/output.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/output.xmap
Tue May  3 07:54:43 2005
@@ -82,8 +82,8 @@
     Resolving factory
     Project implementation of templates have priority before default ones.
     If no implementation can be found we use the noFt (~ - no forrest:template) implementation.
-    -->
-  <map:match pattern="resolve.contract.*">
+    {1} name of the contract-->
+  <map:match pattern="resolve.contract.xhtml.*">
     <map:select type="exists">
       <map:when test="{project:resources}/templates/{1}.ft">
         <map:generate src="{project:resources}/templates/{1}.ft"/>
@@ -97,34 +97,51 @@
     </map:select>
     <map:serialize type="xml"/>
   </map:match>
-  <!--
+  
+   <!-- <!-#-INTERFACE
     Get the xsl:templates of the requested contract.
-  -->
+  {1} format to deliver
+  {2} contract name-#->
    <map:match pattern="get.contract.*.*">
      <map:generate src="cocoon:/resolve.contract.{2}"/>
      <map:transform src="resources/stylesheets/contract.xsl">
-      <!--Which output format?-->
+      <!-#-Which output format?-#->
       <map:parameter name="format" value="{1}"/>
      </map:transform>
      <map:serialize type="xml"/>
+   </map:match>-->
+  
+  <!--IMPLEMENTATION
+    Get the xsl:templates of the requested contract.
+  {html} format to deliver
+  {2} contract name-->
+   <map:match pattern="get.contract.*.xhtml">
+     <map:generate src="cocoon:/resolve.contract.xhtml.{1}"/>
+     <map:transform src="resources/stylesheets/contract.xsl">
+      <!--Which output format?-->
+      <map:parameter name="format" value="xhtml"/>
+     </map:transform>
+     <map:serialize type="xml"/>
    </map:match>
   <!--
   Get the forrest:properties of the requested contract. 
   This will determine which templates (css, head, body) we have to call later on
+  {1} format to deliver
+  {2} contract name
   -->
-   <map:match pattern="get.contract-property.*.*">
-     <map:generate src="cocoon:/resolve.contract.{2}"/>
+   <map:match pattern="get.contract-property.*.xhtml">
+     <map:generate src="cocoon:/resolve.contract.xhtml.{1}"/>
      <map:transform src="resources/stylesheets/contract.property.xsl">
       <!--Which output format?-->
-      <map:parameter name="format" value="{1}"/>
+      <map:parameter name="format" value="xhtml"/>
      </map:transform>
      <map:serialize type="xml"/>
    </map:match>
   <!--
-  Get the css of the requested contract. 
+  Get the css of the requested contract {1}. 
   -->
    <map:match pattern="get.contract-css.*">
-     <map:generate src="cocoon:/resolve.contract.{1}"/>
+     <map:generate src="cocoon:/resolve.contract.xhtml.{1}"/>
      <map:transform src="resources/stylesheets/contract.css.xsl"/>
      <map:serialize type="txt"/>
    </map:match>
@@ -216,14 +233,14 @@
   -->   
     <map:match pattern="*.html">
       <map:generate src="cocoon://{1}.page"/>
-      <map:transform src="cocoon://prepare.xhtml.{1}">
+      <map:transform src="cocoon://getStylesheet.xhtml.{1}">
         <map:parameter name="path" value="{0}"/>
       </map:transform>
      	<map:serialize type="xhtml"/>
     </map:match>
     <map:match pattern="**/*.html">
       <map:generate src="cocoon://{1}/{2}.page"/>
-      <map:transform src="cocoon://prepare.xhtml.{1}/{2}">
+      <map:transform src="cocoon://getStylesheet.xhtml.{1}/{2}">
         <map:parameter name="path" value="{0}"/>
       </map:transform>
      	<map:serialize type="xhtml"/>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs/index.xml?rev=167914&r1=167913&r2=167914&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs/index.xml
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper/src/documentation/content/xdocs/index.xml
Tue May  3 07:54:43 2005
@@ -43,6 +43,7 @@
 </li>
 		<li>Add after the <![CDATA[<xsl:template name="nav-main-body"/>]]> something
like 
 </li>
+</ol>
 		<source><![CDATA[<xsl:template match="ul[@id='nav-main']">
 <div id="nav-main">
   <xsl:apply-templates select="li"/>
@@ -58,6 +59,7 @@
   <xsl:apply-templates/>
 </div>
 </xsl:template>]]></source>
+<ol>
 <li>Change the css in <![CDATA[<xsl:template name="nav-main-css">]]>. I
tried but
 the result is not nice. If you succeed please change the name of the
 contract to "nav-main-div", add the patch to the issue-tracker and I add



Mime
View raw message