You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2005/12/19 18:35:31 UTC

svn commit: r357730 - in /logging/log4j/trunk: build.properties.sample build.xml src/xdocs/stylesheets/site.vsl

Author: carnold
Date: Mon Dec 19 09:35:26 2005
New Revision: 357730

URL: http://svn.apache.org/viewcvs?rev=357730&view=rev
Log:
Bug 37960: Update site generation to velocity 1.4

Added:
    logging/log4j/trunk/src/xdocs/stylesheets/site.vsl   (with props)
Modified:
    logging/log4j/trunk/build.properties.sample
    logging/log4j/trunk/build.xml

Modified: logging/log4j/trunk/build.properties.sample
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/build.properties.sample?rev=357730&r1=357729&r2=357730&view=diff
==============================================================================
--- logging/log4j/trunk/build.properties.sample (original)
+++ logging/log4j/trunk/build.properties.sample Mon Dec 19 09:35:26 2005
@@ -28,19 +28,20 @@
 # Servlet api
 servlet-api.jar=${lib.home.dir}/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar
 
-# SLF4J api
-slf4j-api.jar=${lib.home.dir}/slf4j-1.0-beta4/slf4j-nop.jar
-
-# The templates for the creation of the web-pages are inherited 
-# from the parent project.
-logging-site=../logging-site
+# Velocity's Anakia task is used in the generation of the documentation
+# download from http://jakarta.apache.org
+velocity.jar=${lib.home.dir}/velocity-1.4/velocity-dep-1.4.jar
+# Velocity's Anakia task requires JDOM, 
+# but Velocity 1.4 is not compatible with JDOM 1.0, but beta 8 works okay
+# download for http://www.jdom.org/dist/binary/archive
+jdom.jar=${lib.home.dir}/jdom-b8/build/jdom.jar
 
 # Describes the relative or full path to the Jakarta ORO Reg Exp jar file
 # Required if you wish to use LogFilePatternReceiver or LikeRule (regexp)
 jakarta-oro.jar=${lib.home.dir}/jakarta-oro-2.0.8/jakarta-oro-2.0.8.jar
 
 
-# DBAppeder/DBReceiver OPTIONAL: 
+# DBAppender/DBReceiver OPTIONAL: 
 #
 # The org.apache.log4j.db package makes use of the
 # javax.sql.DataSource interface which is included part of the JDBC

Modified: logging/log4j/trunk/build.xml
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/build.xml?rev=357730&r1=357729&r2=357730&view=diff
==============================================================================
--- logging/log4j/trunk/build.xml (original)
+++ logging/log4j/trunk/build.xml Mon Dec 19 09:35:26 2005
@@ -105,9 +105,8 @@
 
   <!-- Construct classpath for building the html pages-->
   <path id="site.classpath">
-    <fileset dir="${logging-site}/lib">
-      <include name="*.jar"/>
-    </fileset>
+    <pathelement location="${velocity.jar}"/>
+    <pathelement location="${jdom.jar}"/>
   </path>
 
 
@@ -762,7 +761,7 @@
   <target name="checkSite" depends="prepareSite" unless="AnakiaTask.present">
     <echo>
       AnakiaTask is not present! Please check to make sure that
-      velocity.jar is in your classpath.
+      the velocity.jar property is specified and contains the correct path. 
     </echo>
   </target>
 
@@ -772,7 +771,7 @@
     </taskdef>
     
     <mkdir dir="${docs.dest}/css"/>  
-    <copy file="${logging-site}/docs/css/site.css" tofile="${docs.dest}/css/site.css"/>
+    <copy file="docs/css/site.css" tofile="${docs.dest}/css/site.css"/>
     
     <anakia basedir="${xdocs.src}" destdir="${docs.dest}/"
             extension=".html"
@@ -781,7 +780,7 @@
             excludes="**/stylesheets/**, empty.xml"
             includes="**/*.xml"
             lastModifiedCheck="true"
-            templatePath="${logging-site}/src/xdocs/stylesheets">
+            templatePath="${xdocs.src}/stylesheets">
     </anakia>
     
   </target>

Added: logging/log4j/trunk/src/xdocs/stylesheets/site.vsl
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/src/xdocs/stylesheets/site.vsl?rev=357730&view=auto
==============================================================================
--- logging/log4j/trunk/src/xdocs/stylesheets/site.vsl (added)
+++ logging/log4j/trunk/src/xdocs/stylesheets/site.vsl Mon Dec 19 09:35:26 2005
@@ -0,0 +1,322 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+    ## Defined variables
+    #set ($bodybg = "#ffffff")
+    #set ($bodyfg = "#000000")
+    #set ($bodylink = "#525D76")
+
+    #set ($titlebg = "#FFFFFF")
+    #set ($titlefg = "#2222AA")
+
+    #set ($bannerbg = "#FFFFFF")
+    #set ($bannerfg = "#2222AA")
+
+    #set ($subbannerbg = "#828DA6")
+    #set ($subbannerfg = "#ffffff")
+    
+<!-- start the processing -->
+#document()
+<!-- end the processing -->
+
+## This is where the macro's live
+
+#macro ( projectanchor $name $value )
+  #if ($value.startsWith("http://"))
+      <a href="$value">$name</a>
+  #else
+      <a href="$relativePath$value">$name</a>
+  #end
+#end
+
+#macro ( metaauthor $author $email )
+            <meta name="author" value="$author">
+            <meta name="email" value="$email">
+#end
+
+#macro ( image $value )
+#if ($value.getAttributeValue("width"))
+#set ($width=$value.getAttributeValue("width"))
+#end
+#if ($value.getAttributeValue("height"))
+#set ($height=$value.getAttributeValue("height"))
+#end
+#if ($value.getAttributeValue("align"))
+#set ($align=$value.getAttributeValue("align"))
+#end
+<img src="$relativePath$value.getAttributeValue("src")" width="$!width" height="$!height" align="$!align">
+#end
+
+## ============================================
+##  subsection macro
+## ============================================
+#macro ( subsection $subsection)
+        <h3>$subsection.getAttributeValue("name")</strong></h3>
+        #foreach ( $items in $subsection.getChildren() )
+            #if ($items.getName().equals("img"))
+                #image ($items)
+            #elseif ($items.getName().equals("source"))
+                #source ($items)
+            ## #elseif ($items.getName().equals("table"))
+            ##    #table ($items)
+            #else
+                $items
+            #end
+        #end
+#end
+
+## ===================================
+##          titleSection macro
+## ===================================
+#macro ( titleSection $titleSection)
+  <font size="+2" color="$titlefg"><b>$titleSection.getAttributeValue("name")</b></font>
+#end
+
+## ================================
+##          section macro
+## ================================
+#macro ( section $section)
+  <h1>$section.getAttributeValue("name")</strong></h1>
+        #foreach ( $items in $section.getChildren() )
+            #if ($items.getName().equals("img"))
+                #image ($items)
+            #elseif ($items.getName().equals("source"))
+                #source ($items)
+            ##elseif ($items.getName().equals("table"))
+            ##    #table ($items)
+            #elseif ($items.getName().equals("subsection"))
+                #subsection ($items)
+            #else
+                $items
+            #end
+        #end
+#end
+
+## ===================================
+##  make navigation bar
+## ===================================
+
+#macro ( makeNavigationBar )
+  <!-- ============================================================ -->
+  <div class="leftcol">
+    #set ($menus = $project.getChild("body").getChildren("menu"))
+    #foreach ( $menu in $menus )
+       <div class="menu_header">$menu.getAttributeValue("name")</div>
+       #foreach ($item in $menu.getChildren() )
+       	 #set ($name = $item.getAttributeValue("name"))
+       	 <div class="menu_item">#projectanchor($name $item.getAttributeValue("href"))</div>
+       #end  
+    #end
+  </div> 
+   
+#end
+
+## ====================================
+##      getProjectImage
+## ====================================
+#macro (getProjectImage)
+   ##<div class="banner">
+   ##<table class="banner" width="100%" border="0">
+   <table class="banner" border="0">
+     <tr>
+       <td valign="top">
+         <a href="http://logging.apache.org/">
+           <img src="http://logging.apache.org/images/ls-logo.jpg" border="0"/>
+         </a>
+         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+         <a href="http://apachecon.com/2005/US/">
+           <img src="http://apache.org/images/ac2005us_blue_184x90.jpg" />
+         </a>
+       <td align="right">
+           #if ($project.getChild("logo"))
+             #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
+             #if ( $logoString.startsWith("/") )
+     	       <a href="$project.getAttributeValue("href")">
+      	         <img src="$relativePath$logoString" 
+      	           alt="$project.getChild("logo").getText()" border="0"/>
+      	       </a>
+             #else
+      	       <a href="$project.getAttributeValue("href")">
+                 <img src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" border="0"/>
+      	       </a>
+             #end
+           #end  
+       </td>
+     </tr>
+   </table>
+   ##</div>
+#end
+
+#macro (printMeta $metaElement)
+<meta #set ($attribs = $metaElement.getAttributes())
+#foreach ($a in $attribs) $a.getName()="$a.getValue()" #end />
+#end
+
+#macro (faqIndex $root)
+
+  #set( $section = 1 )
+
+  #foreach ( $s in $root.getChild("body").getChildren() )
+    #if ($s.getName().equals("faqSection"))
+      #set( $counter = 1 )
+      <br/>
+      <div class="index-faqSection">
+        Section $section. <a href="#$section"> $s.getChild("title").getContent()</a>
+      </div>
+
+      #foreach ( $q in $s.getChildren() )
+        #if ($q.getName().equals("question"))
+           <table class="index-question">
+              <td nowrap="true" valign="top">Question $section.$counter</td>	      
+              <td><a href="#$section.$counter">$q.getChild("title").getContent()</a></td>           
+            </table>
+          #set( $counter = $counter + 1 )
+        #end
+      #end
+    #set( $section = $section + 1 )
+    #end
+  #end
+#end
+
+#macro (faqContents $root)
+  <hr/>
+
+  #set( $section = 1 )
+
+  #foreach ( $s in $root.getChild("body").getChildren() )
+    #if ($s.getName().equals("faqSection"))
+      #set( $counter = 1 )
+      <div class="faqSection">
+        <a name="$section">Section $section.</a> $s.getChild("title").getContent()
+      </div>
+      #foreach ( $i in $s.getChildren() )
+        #if ($i.getName().equals("question"))
+           <div class="question">
+             <a name="$section.$counter">$section.$counter $i.getChild("title").getContent()</a>
+           </div>
+           #set( $counter = $counter + 1 )
+           $i.getChild("answer").getContent()
+        #elseif ($i.getName().equals("text"))
+           $i.getContent()
+        #end
+      #end
+    #set( $section = $section + 1 )
+    #end
+  #end
+#end
+
+
+#macro (messages $root)
+  #foreach ( $m in $root.getChild("body").getChildren() )
+    #if ($m.getName().equals("message"))
+      <div class="big">
+        <a name="$m.getAttributeValue('ref')">
+         <table>
+            <tr>
+             <td valign="top"><b>Message:</b></td>
+             <td class="msg_title">$m.getChild("title").getContent()</td>
+            </tr>
+         </table> 
+        </a>
+      </div>
+      <div class="msg_meaning">
+        $m.getChild("explanation").getContent()
+      </div>
+    #end
+  #end
+#end
+
+#macro (document)
+    #set ($properties =  $root.getChild("properties") )
+    <!-- ====================================================================== -->
+    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+            #set ($authors = $properties.getChildren("author"))
+            #foreach ( $au in $authors )
+                #metaauthor ( $au.getText() $au.getAttributeValue("email") )
+            #end
+
+            #set ($metas = $root.getChildren("meta"))
+
+            ##    Parse meta directives such as
+            ##    <meta name="keyword" content="jakarta, java"/>
+            #foreach ($meta in $metas) #printMeta($meta) #end
+
+            ##    Support for <base> tags.
+            #if ($properties.getChild("base"))
+              #set ($url = $properties.getChild("base").getAttributeValue("href"))
+              <base href="$url"/>
+            #end
+ 
+            <link href="$relativePath/css/site.css" rel="stylesheet" type="text/css"/>
+            #set ($links = $properties.getChildren("link"))
+            #foreach ( $l in $links )
+              <link href="$l.getAttributeValue("href")" rel="stylesheet" type="text/css"/>
+            #end
+           
+
+            <title>$project.getChild("title").getText() - $properties.getChild("title").getText()</title>
+        </head>
+
+        <body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">        
+           <!-- START Header table --> 
+            #getProjectImage()
+           <!-- END Header table --> 
+
+	   <div class="centercol">
+             <hr noshade="" size="1"/>
+		       
+           #foreach ( $item in $root.getChild("body").getChildren() )
+             #if ($item.getName().equals("img"))
+               #image ($item)
+             #elseif ($item.getName().equals("section"))
+               #section ($item)
+             #elseif ($item.getName().equals("faqSection"))
+               ## do nothing, we'll handle the faq later
+             #elseif ($item.getName().equals("message"))
+               ## do nothing, we'll handle the faq later
+             #else
+               $item
+              #end 
+            #end
+
+            #faqIndex ($root)	
+            #faqContents ($root)
+            #messages ($root)	
+
+##                    #if ($root.getChild("body").getChild("titleSection"))
+##                      #set ($titleSection = $root.getChild("body").getChild("titleSection"))
+##                      #titleSection($titleSection)
+##                    #end
+##
+##                    #set ($allSections = $root.getChild("body").getChildren("section"))
+##                    #foreach ( $section in $allSections )
+##                       #section ($section)
+##                    #end
+
+             
+                <!-- FOOTER -->
+              <div align="center"><font color="$bodylink" size="-1"><em>
+                 Copyright &#169; 1999-2005, Apache Software Foundation
+               </em></font></div>
+
+           <!-- END main table --> 
+
+           <!-- LEFT SIDE NAVIGATION -->
+           #makeNavigationBar()
+
+        </body>
+    </html>
+#end
+
+
+
+
+

Propchange: logging/log4j/trunk/src/xdocs/stylesheets/site.vsl
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org