You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cd...@apache.org on 2006/08/08 14:59:05 UTC

svn commit: r429641 - in /forrest/trunk: main/webapp/resources/stylesheets/ whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/ whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/

Author: cdupoirieux
Date: Tue Aug  8 05:59:05 2006
New Revision: 429641

URL: http://svn.apache.org/viewvc?rev=429641&view=rev
Log:
Add dispatcher.theme to the defaultVariables (variable.helper.xsl + themes.xmap)
Update branding-css-links.ft to set the default value of the Title attribute of link tag to dispatcher.theme (with the first letter in Capital).
Cf. http://marc.theaimsgroup.com/?l=forrest-dev&m=114923682228486&w=2

Modified:
    forrest/trunk/main/webapp/resources/stylesheets/variable.helper.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/branding-css-links.ft

Modified: forrest/trunk/main/webapp/resources/stylesheets/variable.helper.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/resources/stylesheets/variable.helper.xsl?rev=429641&r1=429640&r2=429641&view=diff
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/variable.helper.xsl (original)
+++ forrest/trunk/main/webapp/resources/stylesheets/variable.helper.xsl Tue Aug  8 05:59:05 2006
@@ -22,6 +22,7 @@
   <xsl:import href="lm://transform.xml.dotdots"/>
   <xsl:import href="lm://transform.xml.pathutils"/>
   <xsl:param name="path" select="'test.html'"/>
+  <xsl:param name="theme" select="'notheme'"/>
   <!-- Path (..'s) to the root directory -->
   <xsl:variable name="root">
     <xsl:call-template name="dotdots">
@@ -50,6 +51,7 @@
         <property name="filename-noext" value="{$filename-noext}"/>
         <property name="root" value="{$root}"/>
         <property name="path" value="{$path}"/>
+        <property name="theme" value="{$theme}"/>
       </properties>
     </xsl:template>
 </xsl:stylesheet>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap?rev=429641&r1=429640&r2=429641&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap Tue Aug  8 05:59:05 2006
@@ -48,6 +48,7 @@
         <map:generate src="foo.xml" />
         <map:transform src="lm://transform.xml.variable.helper">
           <map:parameter name="path" value="{1}.html" />
+          <map:parameter name="theme" value="{project:dispatcher.theme}" />
         </map:transform>
         <map:serialize type="xml" />
       </map:match>
@@ -122,4 +123,4 @@
       </map:match>
     </map:pipeline>
   </map:pipelines>
-</map:sitemap>
\ No newline at end of file
+</map:sitemap>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/branding-css-links.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/branding-css-links.ft?rev=429641&r1=429640&r2=429641&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/branding-css-links.ft (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/branding-css-links.ft Tue Aug  8 05:59:05 2006
@@ -38,12 +38,13 @@
             <source>$FORREST_HOME/whiteboard/plugins/org.apache.forrest.themes.core/resources/themes/common/css/</source>
           </li>
         </ul>
+     The <strong>url</strong> attribute is required.
       </li>
-      <li><strong>media</strong> to the browser the stylesheets to use
+      <li><strong>media</strong> attribute indicates to the browser the stylesheets to use
      depending on the detination media :
         <ul>
-          <li>screen : the stylesheet is used with the browser displaying the page on the screen,</li>
-          <li>print : the stylesheet is used while printing the document - or print preview...</li>
+          <li><em>screen</em> : the stylesheet is used with the browser displaying the page on the screen,</li>
+          <li><em>print</em> : the stylesheet is used while printing the document - or print preview...</li>
           <li>othervalues can also be managed by browsers.cf. <a href="http://www.w3.org/TR/REC-CSS2/media.html#media-types" class="fork">W3C Media Types</a>.</li>
         </ul>
         <div class="note">
@@ -55,7 +56,8 @@
       </li>
       <li><strong>theme</strong> attribute indicates to the browser for which theme this
         stylesheet should be used, letting you add several css files
-        corresponding to different themes of the same page.
+        corresponding to different themes of the same page.<br/>
+        If omitted, the <strong>theme</strong> attribute take the value of the <code>dispatcher.theme</code> property that you should have defined in your forrest.properties.xml file.
       </li>
     </ul>
   </description>
@@ -73,6 +75,8 @@
       <xsl:param name="defaultVariables" select="'test.html'"/>
       <xsl:param name="branding-css-links-input"/>
       <xsl:variable name="root" select="$defaultVariables/*/*[@name='root']/@value"/>
+      <xsl:variable name="theme" select="$defaultVariables/*/*[@name='theme']/@value"/>
+
       <xsl:template match="/">
         <forrest:content>
           <forrest:part xpath="/html/head">
@@ -102,7 +106,7 @@
             </xsl:when>
             <xsl:otherwise>
               <xsl:attribute name="title">
-                <xsl:value-of select="@url"/>
+                <xsl:value-of select="concat( translate( substring($theme, 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring($theme,2))"/>
               </xsl:attribute>
             </xsl:otherwise>
           </xsl:choose>