You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by wg...@apache.org on 2005/07/11 20:03:21 UTC

svn commit: r210169 - in /jakarta/velocity/core/trunk: build/ docs/ xdocs/ xdocs/docs/ xdocs/images/ xdocs/stylesheets/ xdocs/translations/ xdocs/ymtd/

Author: wglass
Date: Mon Jul 11 11:03:17 2005
New Revision: 210169

URL: http://svn.apache.org/viewcvs?rev=210169&view=rev
Log:
major revision of web site and documentation to be more accessible to new users, removed outdated content, and cleaned it up.  Changed logo and converted layout to use CSS for cleaner design.

Added:
    jakarta/velocity/core/trunk/xdocs/.htaccess
    jakarta/velocity/core/trunk/xdocs/build.xml
    jakarta/velocity/core/trunk/xdocs/committers.xml
    jakarta/velocity/core/trunk/xdocs/docs/
    jakarta/velocity/core/trunk/xdocs/docs/anakia.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/anakia.xml
    jakarta/velocity/core/trunk/xdocs/docs/changes.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/changes.xml
    jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/developer-guide.xml
    jakarta/velocity/core/trunk/xdocs/docs/license.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/license.xml
    jakarta/velocity/core/trunk/xdocs/docs/texen.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/texen.xml
    jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/user-guide.xml
    jakarta/velocity/core/trunk/xdocs/docs/veltag.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/veltag.xml
    jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/vtl-reference-guide.xml
    jakarta/velocity/core/trunk/xdocs/images/newlogo.png   (with props)
    jakarta/velocity/core/trunk/xdocs/overview.xml
    jakarta/velocity/core/trunk/xdocs/site.css
    jakarta/velocity/core/trunk/xdocs/stylesheets/wiki.vsl
    jakarta/velocity/core/trunk/xdocs/translations/
    jakarta/velocity/core/trunk/xdocs/translations/user-guide_es.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/user-guide_es.xml
    jakarta/velocity/core/trunk/xdocs/translations/user-guide_fi.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/user-guide_fi.xml
    jakarta/velocity/core/trunk/xdocs/translations/user-guide_fr.xml
      - copied unchanged from r209479, jakarta/velocity/core/trunk/xdocs/user-guide_fr.xml
    jakarta/velocity/core/trunk/xdocs/webapps.xml
Removed:
    jakarta/velocity/core/trunk/docs/
    jakarta/velocity/core/trunk/xdocs/anakia.xml
    jakarta/velocity/core/trunk/xdocs/casestudy1.xml
    jakarta/velocity/core/trunk/xdocs/casestudy2.xml
    jakarta/velocity/core/trunk/xdocs/changes.xml
    jakarta/velocity/core/trunk/xdocs/code-standards.xml
    jakarta/velocity/core/trunk/xdocs/contributors.xml
    jakarta/velocity/core/trunk/xdocs/design.xml
    jakarta/velocity/core/trunk/xdocs/developer-guide.xml
    jakarta/velocity/core/trunk/xdocs/devtools.xml
    jakarta/velocity/core/trunk/xdocs/differences.xml
    jakarta/velocity/core/trunk/xdocs/images/logo.gif
    jakarta/velocity/core/trunk/xdocs/install.xml
    jakarta/velocity/core/trunk/xdocs/license.xml
    jakarta/velocity/core/trunk/xdocs/migration.xml
    jakarta/velocity/core/trunk/xdocs/newshistory.xml
    jakarta/velocity/core/trunk/xdocs/powered.xml
    jakarta/velocity/core/trunk/xdocs/specification-ast.xml
    jakarta/velocity/core/trunk/xdocs/specification-bnf.xml
    jakarta/velocity/core/trunk/xdocs/specification.xml
    jakarta/velocity/core/trunk/xdocs/texen.xml
    jakarta/velocity/core/trunk/xdocs/todo.xml
    jakarta/velocity/core/trunk/xdocs/user-guide.xml
    jakarta/velocity/core/trunk/xdocs/user-guide_es.xml
    jakarta/velocity/core/trunk/xdocs/user-guide_fi.xml
    jakarta/velocity/core/trunk/xdocs/user-guide_fr.xml
    jakarta/velocity/core/trunk/xdocs/velocity_and_weblogic.xml
    jakarta/velocity/core/trunk/xdocs/veltag.xml
    jakarta/velocity/core/trunk/xdocs/vtl-reference-guide.xml
    jakarta/velocity/core/trunk/xdocs/ymtd/
Modified:
    jakarta/velocity/core/trunk/build/build.xml
    jakarta/velocity/core/trunk/xdocs/   (props changed)
    jakarta/velocity/core/trunk/xdocs/getting-started.xml
    jakarta/velocity/core/trunk/xdocs/index.xml
    jakarta/velocity/core/trunk/xdocs/stylesheets/project.xml
    jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl

Modified: jakarta/velocity/core/trunk/build/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/build/build.xml?rev=210169&r1=210168&r2=210169&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/build/build.xml (original)
+++ jakarta/velocity/core/trunk/build/build.xml Mon Jul 11 11:03:17 2005
@@ -12,6 +12,10 @@
 
   <property name="Name" value="Velocity"/>
   <property name="version" value="1.5-dev"/>
+  
+  <!-- the name of the versioned product documentation -->
+  <property name="docsfolder" value="docs15"/>
+
   <property name="project" value="velocity"/>
     
   <property name="build.dir" value="../bin"/>
@@ -33,7 +37,6 @@
   <property name="deprecation" value="off"/>
 
   <property name="docs.dest" value="../docs"/>
-  <property name="docs_print.dest" value="../docs_print"/>
   <property name="docs.src" value="../xdocs"/>
 
   <!-- jars explicitly needed for bulding 'dep jar' -->    
@@ -115,8 +118,8 @@
   **  examples-clean-all                 cleans the anakia/forumdemo examples
   **  javadocs       prepare             build javadocs
   **  javadocs-clean                     delete javadocs
-  **  docs           jar                 Velocity Documentation
-  **  docs_print     jar                 Velocity Documentation (printable)
+  **  docs           jar                 Generates Velocity Documentation
+  **  docs-clean                         Cleans generated Velocity Documentation
   **  test           compile             runs JUnit tests
   **  test-clean                         deletes test results
   **  clean                              deletes build dir
@@ -693,69 +696,32 @@
               <include name="**/*.gif"/>
               <include name="**/*.jpeg"/>
               <include name="**/*.jpg"/>
+              <include name="**/*.png"/>
           </fileset>
       </copy>
   
-      <!-- In case we have CSS someday
       <copy todir="${docs.dest}" filtering="no">
           <fileset dir="${docs.src}">
               <include name="**/*.css"/>
+              <include name="**/.htaccess"/>
           </fileset>
       </copy>
-      -->
-  </target>
-  <!-- =================================================================== -->
-  <!-- Make printable HTML version of Velocity documentation                         -->
-  <!-- =================================================================== -->
-
-  <target name="docs_print" 
-          depends="jar"
-          description="generates the HTML documentation (printable)"
-          >
-
-      <taskdef name="anakia"
-          classname="org.apache.velocity.anakia.AnakiaTask">
-          
-          <classpath>
-             <pathelement location="${build.dir}/${project}-${version}.jar"/>
-             <path refid="classpath"/>
-          </classpath>
-
-      </taskdef>
 
-      <echo>
-       #######################################################
-       #
-       #  Now using Anakia to transform our XML documentation
-       #  to HTML.
-       #
-       #######################################################
-      </echo>
-
-      <anakia basedir="${docs.src}" destdir="${docs_print.dest}/"
-           extension=".html" style="./site_printable.vsl"
-           projectFile="stylesheets/project.xml"
-           excludes="**/stylesheets/** empty.xml"
-           includes="**/*.xml"
-           lastModifiedCheck="true"
-	       templatePath="../xdocs/stylesheets">
-      </anakia>
-
-      <copy todir="${docs_print.dest}/images" filtering="no">
-          <fileset dir="${docs.src}/images">
-              <include name="**/*.gif"/>
-              <include name="**/*.jpeg"/>
-              <include name="**/*.jpg"/>
+      <!-- copy product docs into versioned folder -->
+      <copy todir="${docs.dest}/${docsfolder}" filtering="no">
+          <fileset dir="${docs.dest}/docs">
+              <include name="*.html"/>
           </fileset>
       </copy>
+        
+  </target>
   
-      <!-- In case we have CSS someday
-      <copy todir="${docs.dest}" filtering="no">
-          <fileset dir="${docs.src}">
-              <include name="**/*.css"/>
-          </fileset>
-      </copy>
-      -->
+  
+  <!-- =================================================================== -->
+  <!-- Cleans up the docs directory                                       -->
+  <!-- =================================================================== -->
+  <target name="docs-clean">
+    <delete dir="${docs.dest}" quiet="true"/>
   </target>
 
 

Propchange: jakarta/velocity/core/trunk/xdocs/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jul 11 11:03:17 2005
@@ -0,0 +1 @@
+docs

Added: jakarta/velocity/core/trunk/xdocs/.htaccess
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/.htaccess?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/.htaccess (added)
+++ jakarta/velocity/core/trunk/xdocs/.htaccess Mon Jul 11 11:03:17 2005
@@ -0,0 +1,10 @@
+RewriteEngine  on
+RewriteBase /
+RewriteRule ^anakia\.html docs14/anakia.html 
+RewriteRule ^changes\.html docs14/changes.html 
+RewriteRule ^developer-guide\.html docs14/developer-guide.html 
+RewriteRule ^license\.html docs14/license.html 
+RewriteRule ^texen\.html docs14/texen.html 
+RewriteRule ^user-guide\.html docs14/user-guide.html 
+RewriteRule ^veltag\.html docs14/veltag.html 
+RewriteRule ^vtl-reference-guide\.html docs14/vtl-reference-guide.html 

Added: jakarta/velocity/core/trunk/xdocs/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/build.xml?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/build.xml (added)
+++ jakarta/velocity/core/trunk/xdocs/build.xml Mon Jul 11 11:03:17 2005
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+
+<document>
+
+ <properties>
+  <title>Building Velocity from Source</title>
+  <author email="jvanzyl@zenplex.com">Velocity Documentation Team</author>
+ </properties>
+
+<body>
+
+<section name="Installation">
+
+<p>
+Velocity runs on a variety of platforms that have installed the Java 2
+Virtual Machine. The J2SDK is required for users who want to compile
+Velocity from its source code.
+</p>
+
+<p>
+Everything required to build Velocity comes with the distribution, which
+can be obtained from <a
+href="http://www.apache.org/dev/version-control.html">Subversion</a> or
+from the <a
+href="http://cvs.apache.org/snapshots/velocity/">nightly
+builds</a>.  However, you will need to install Ant, an excellent
+Java-based build tool.  Ant is also a Jakarta project, and can be
+found <a href="http://jakarta.apache.org/ant/">here</a>.
+</p>
+
+<p>
+The directory tree of the distribution looks like :
+</p>
+
+<source><![CDATA[
+jakarta-velocity
+  /build        - contains build scripts
+  /bin          - where the built jars / classes will go
+  /src          - sourcecode for Velocity, Anakia, and Texen
+  /docs         - documentation in HTML form
+  /docs/api     - Javadocs for Velocity source
+  /examples     - example/demonstration code
+  /convert      - tools to help convert WebMacro templates
+  /test         - test programs and templates
+  /xdocs        - source for our documentation
+]]></source>
+
+</section>
+
+<section name="Building">
+
+<p>
+To make building Velocity easy and consistant, we require a Jakarta project
+called <a href="http://jakarta.apache.org/ant/">Ant</a> version 1.3 or
+higher to perform the build process. We assume that you have followed
+Ant's installation instructions and have it properly installed.  It's not
+difficult, and I think that you will find it an excellent addition to
+your programmer's toolbox.
+</p>
+
+<p>
+In each case below, it is assumed that you were successful in getting
+the distribution from Subversion or as a nightly build, and with the latter,
+were successful in unpacking.  Also, it is assumed that you are starting
+in the 'jakarta-velocity' directory, the root of the distribution tree. 
+All directory references will be relative to 'jakarta-velocity'.
+</p>
+
+<p>
+Change to the <filename>build</filename> directory (<code>cd
+build</code>). Then, to build the jar file, simply type:
+</p>
+
+<source><![CDATA[
+ant
+]]></source>
+
+<p>
+Executing this script will create a <filename>bin</filename> directory
+within the Velocity distribution directory. The <filename>bin</filename>
+directory will contain the compiled class files (inside a
+<filename>classes</filename> directory) as well as a
+<filename>velocity-XX.jar</filename> file, where XX is the current
+version number. Be sure to update your classpath to include Velocity's
+<filename>.jar</filename> file.
+</p>
+
+<p>
+Note that to build any of the specific build targets, as detailed in
+the <a href="developer-guide.html">developers guide</a>, simply add
+the target name to the command line.  For example, to build the Javadoc
+API documentation :
+</p>
+
+<source><![CDATA[
+ant javadocs
+]]></source>
+
+<p>
+Velocity should build 'out of the box', independent of your classpath.
+If you get an error building Velocity, try a different nightly build (as
+sometimes we make a mistake and the Subversion at the time of the nightly
+snapshot isn't complete) or refresh from Subversion (you might have gotten a
+Subversion snapshot while a developer was checking things in.)
+</p>
+
+<p>
+If the problems persist, do not hesitate to ask the Velocity community
+via our mail lists. They can be found <a
+href="http://jakarta.apache.org/site/mail.html">here</a>. Please read
+and understand the the guidelines for participating in any Jakarta mail
+list.
+</p>
+
+</section>
+
+<section name="Testing Your Installation">
+
+<p>
+The Velocity developers use an automated test facility, and it is
+included in the distribution. You can use it to make sure that all is
+well with your build of Velocity.
+</p>
+
+<p>
+To run the test suite, simply use the build target
+<filename>test</filename> when you build :
+</p>
+<source><![CDATA[
+ant test
+]]></source>
+
+<p>
+If all is well, you should see output similar to :
+</p>
+
+<source><![CDATA[
+junittest:
+    [junit] Running org.apache.velocity.util.TestSimplePool
+    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.025 sec
+
+test:
+
+test-template:
+     [echo] Running Template tests...
+     [java] Adding TemplateTestCase : arithmetic
+     ...
+     ...
+     ...
+     [java] Adding TemplateTestCase : foreach-introspect
+     [java] Adding TemplateTestCase : settest
+     [java] .......................................
+     [java] Time: 1.999
+
+     [java] OK (39 tests)
+
+
+test-velocityapp:
+     [echo] Running app.Velocity tests...
+     [java] .
+     [java] Time: 0.004
+
+     [java] OK (1 tests)
+
+
+...
+
+BUILD SUCCESSFUL
+Total time: 42 seconds
+
+]]></source>
+
+<p>
+Note that the number of tests may vary from those shown above, but if
+you see 'OK' after the tests are run, all is well.  Now it's time to use
+Velocity.
+</p>
+</section>
+
+</body>
+</document>
\ No newline at end of file

Added: jakarta/velocity/core/trunk/xdocs/committers.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/committers.xml?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/committers.xml (added)
+++ jakarta/velocity/core/trunk/xdocs/committers.xml Mon Jul 11 11:03:17 2005
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+
+<document>
+
+ <properties>
+  <title>Velocity Committers</title>
+  <author email="wglass@apache.org">Velocity Documentation Team</author>
+ </properties>
+
+<body>
+
+
+<section name="Committers">
+
+<p>While many individuals have contributed to Velocity 
+in past and present, the following are the currently active committers 
+for the project.  
+</p>
+<p>
+Listed alphabetically:
+</p>
+
+<table>
+
+    <tr>
+        <th>Name</th>
+        <th>Email</th>
+        <th>Affiliation</th>
+    </tr>
+    
+    <tr>
+        <td>Will Glass-Husain</td>
+        <td>wglass@apache.org</td>
+        <td>Forio Business Simulations</td>
+    </tr>
+
+    <tr>
+        <td>Geir Magnusson Jr.</td>
+        <td>geirm@apache.org</td>
+        <td>Independent</td>
+    </tr>
+
+    <tr>
+        <td>Daniel L. Rall</td>
+        <td>dlr@finemaltcoding.com</td>
+        <td>CollabNet</td>
+    </tr>
+</table>
+
+</section>
+
+</body>
+</document>

Modified: jakarta/velocity/core/trunk/xdocs/getting-started.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/getting-started.xml?rev=210169&r1=210168&r2=210169&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/getting-started.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/getting-started.xml Mon Jul 11 11:03:17 2005
@@ -30,19 +30,36 @@
      guide for VTL, the Velocity Template Language.
    </li>
    <li>
-     The <a href="design.html">Design</a> document, which provides a high-level overview
-     of the how Velocity works, and why it's important.
+     If you want to build a web application, be sure to read the <a href="webapps.html">Web Application Guide</a>
+     and then download the <a href="">Velocity Tools</a> sub-project to use VelocityViewServlet.
     </li>
    </ul>
 
+    
    And of course, the best place to start is with the examples provided with the distribution,
    and the source code itself, which is included.
 </p>
 
-<p>
-    Instructions for downloading and installing Velocity can be found on the
-    <a href="install.html">Install</a> document.
-</p>
+
+</section>
+<section name="Downloading Velocity">
+    <p>
+        You can download the latest release version of 
+        <a href="http://jakarta.apache.org/site/downloads/downloads_velocity-engine.cgi">Velocity</a> 
+        or <a href="http://jakarta.apache.org/site/downloads/downloads_velocity-tools.cgi">Velocity Tools</a> 
+        from the main Jakarta download site.  For Velocity itself, source is included with the binary download.
+    </p>
+
+    <p>
+        If you want to download the latest source, you can do so via the Subversion (svn) 
+        source control system, or download a complete 
+        <a href="http://cvs.apache.org/snapshots/velocity/">nightly snapshot.</a>
+    </p>
+
+    <p>
+        Instructions for building Velocity from source can be found on the
+        <a href="build.html">Build</a> document.
+    </p>
 
 </section>
 

Added: jakarta/velocity/core/trunk/xdocs/images/newlogo.png
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/images/newlogo.png?rev=210169&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/velocity/core/trunk/xdocs/images/newlogo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/velocity/core/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/index.xml?rev=210169&r1=210168&r2=210169&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/index.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/index.xml Mon Jul 11 11:03:17 2005
@@ -8,211 +8,55 @@
  </properties>
 
  <body>
-<section name="Velocity v1.4 Released">
-
- <p>
-   <table>
-   <tr>
-   <td>
-   <img src="images/powered-by-logo.gif" alt="powered-by-logo.gif" width="77" height="32"/>
-   </td>
-   <td>
-   Version 1.4 of the Velocity Template Engine is <i>finally</i> released (2004-4-14)
-   </td>
-   </tr>
-   </table>
- </p>
-
- <p>
-     Changes include :
-
-     <ul>
-         <li>New (and better) introspection code</li>
-         <li>Pluggable introspection</li>
-         <li>Lots of little fixes.  See changelog.</li>
-     </ul>
- </p>
-
-</section>
-
-<section name="Notice : JDOM API Change">
-    <p>
-        As part of their effort to reach v1.0, the JDOM
-        community has made slight modifications to their API.
-        This will affect Velocity users that use the 'Anakia'
-        package.
-    </p>
-
-    <p>
-        Velocity versions 1.4 and older require using a version
-        of JDOM older than beta10rc1.  All new releases of
-        Velocity will require JDOM 1.0.
-    </p>
-</section>
-
-<section name="Velocity News">
-
-
-    <p>
-        <strong>Another Velocity Article</strong>
-        <blockquote>
-        New
-        <a href="http://www.onjava.com/pub/a/onjava/2004/04/14/velocity.html">
-        article</a> on a JSP to Velocity project.
-
-        (<i>2004-04-26</i>)
-        </blockquote>
-    </p>
-
-    <p>
-        <strong>Velocity Dreamweaver Extension</strong>
-        <blockquote>
-        Jason Gill  (aka Pete the Chop) wrote a
-        <a href="http://velocity.gilluminate.com/">
-        Dreamweaver Extension</a> that gives full Velocity support
-        in Dreamweaver.  Give it a look if you use Dreamweaver.
-
-        (<i>2004-04-14</i>)
-        </blockquote>
-    </p>
-
-    <p>
-        <strong>New Article on Velocity</strong>
-        <blockquote>
-        Sing Li discusses how to use Velocity in a standalone application
-        as well as a replacement for JSP in the Struts MVC framework in this
-        <a href="http://www.ibm.com/developerworks/library/j-velocity/">
-        article</a>
-        (<i>2004-02-19</i>)
-        </blockquote>
-    </p>
-    <p>
-        <strong>ALE uses Velocity</strong>
-        <blockquote>
-        Brad Cox is pleased to announce the alpha (0.1) release of the
-        <a href="http://virtualschool.edu/ale/">Action Learning Environment (ALE)</a>
-        , an open source environment for
-        building experiential learning environments.
-        ALE is open source (free) software and is available
-        (<i>2004-1-22</i>)
-        </blockquote>
-
-    </p>
-    <p>
-        <strong>New Article on Velocity</strong>
-        <blockquote>
-        Erik Hatcher's recent article
-        <a href="http://today.java.net/pub/a/today/2003/12/16/velocity.html">
-        Velocity: Fast Track to Templating</a> is currently a featured
-        article at <a href="http://www.java.net/">java.net</a>.
-        (<i>2003-12-23</i>)
-        </blockquote>
-    </p>
-
-    <p>
-        <strong>Velosurf 0.8 Released</strong>
-        <blockquote>
-        <a href="http://velosurf.sourceforge.net">Velosurf</a>,
-        a database access tool for use with the Velocity template engine,
-        has released v0.8
-        (<i>2003-10-21</i>)
-        </blockquote>
-
-    </p>
-    <p>
-        <strong>Generate SOAP messages with Ivory</strong>
-        <blockquote>
-        <a href="http://ivory.codehaus.org/soaplet/index.html">Ivory Soaplet</a>
-            framework uses Velocity to generate SOAP messages.
-        (<i>2003-10-14</i>)
-        </blockquote>
-    </p>
-
-<p>
-    <strong>IntelliJ IDEA Uses Velocity</strong>
-    <blockquote>
-    <a href="http://www.intellij.com/">IntelliJ IDEA</a> uses Velocity as its
-        templating system for generating class and method javaodocs.
-    (<i>2003-10-14</i>)
-    </blockquote>
-</p>
-
-<p>
-<strong>Cotsec Forms Uses Velocity</strong>
-<blockquote>
-<a href="http://www.cotsec.com/">Cotsec</a> has released a
-cross-language/cross-platform rapid development
-environment called Cotsec Forms that uses Velocity as its underlying
-template engine.
-(<i>2003-08-23</i>)
-</blockquote>
-</p>
-
-<p>
-<strong>Velocity Tools 1.0</strong>
-<blockquote>
-The first release of the <a href="tools/index.html">Velocity Tools</a> subproject is 
-<a href="http://jakarta.apache.org/builds/jakarta-velocity-tools/release/v1.0/">available</a>.
-It includes a generic tools package, support for clean, quick MVC web
-development in the VelocityView package, and support for integration with
-the Struts framework.
-(<i>2003-07-16</i>)
-</blockquote>
-</p>
-
-<p>
-<i>Archived articles are <a href="newshistory.html">here</a></i>.
-</p>
-
- </section>
-
- <section name="What is Velocity?">
-
- <p>
-    Velocity is a Java-based template engine. It permits anyone to use
-    the simple yet powerful template language to reference objects
-    defined in Java code.
- </p>
-
- <p>
-    When Velocity is used for web development, Web designers can work in
-    parallel with Java programmers to develop web sites according to the
-    Model-View-Controller (MVC) model, meaning that web page designers
-    can focus solely on creating a site that looks good, and programmers
-    can focus solely on writing top-notch code. Velocity separates Java
-    code from the web pages, making the web site more maintainable over
-    the long run and providing a viable alternative to <a
-    href="http://java.sun.com/products/jsp/">Java Server Pages</a>
-    (JSPs) or <a href="http://www.php.net/">PHP</a>.
- </p>
-
- <p>
-    Velocity's capabilities reach well beyond the realm of the web;
-    for example, it can be used to generate SQL and PostScript and XML
-    (see <a href="./anakia.html">Anakia</a> for more information on
-    XML transformations) from templates.  It can be used either as a
-    standalone utility for generating source code and reports, or as
-    an integrated component of other systems.  For instance, Velocity
-    provides template services for the <a
-    href="http://jakarta.apache.org/turbine/">Turbine</a> web
-    application framework, together providing a view engine
-    facilitating development of web applications according to a true
-    MVC model.
- </p>
-
- </section>
+ 
+ 
+  <section name="What is Velocity?">
+ 
+  <p>
+     Velocity is a Java-based template engine. It permits anyone to use
+     a simple yet powerful template language to reference objects
+     defined in Java code.
+  </p>
+ 
+  <p>
+     When Velocity is used for web development, Web designers can work in
+     parallel with Java programmers to develop web sites according to the
+     Model-View-Controller (MVC) model, meaning that web page designers
+     can focus solely on creating a site that looks good, and programmers
+     can focus solely on writing top-notch code. Velocity separates Java
+     code from the web pages, making the web site more maintainable over
+     its lifespan and providing a viable alternative to <a
+     href="http://java.sun.com/products/jsp/">Java Server Pages</a>
+     (JSPs) or <a href="http://www.php.net/">PHP</a>.
+  </p>
+ 
+  <p>
+     Velocity's capabilities reach well beyond the realm of the web;
+     for example, it can be used to generate SQL, PostScript and XML
+     (see <a href="./anakia.html">Anakia</a> for more information on
+     XML transformations) from templates.  It can be used either as a
+     standalone utility for generating source code and reports, or as
+     an integrated component of other systems.  For instance, Velocity
+     provides template services for the <a
+     href="http://jakarta.apache.org/turbine/">Turbine</a> web
+     application framework, together resulting in a view engine
+     facilitating development of web applications according to a true
+     MVC model.
+  </p>
+ 
+  </section>
 
 
 
 <section name="Where do I get releases?">
 
 <p>
-   The current release version is version 1.4
+   The current release version is version 1.4.
 </p>
 
 <p>
 The release distribution is available in both <code>tar.gz</code> and <code>zip</code>
-formats, and are found <a href="http://www.apache.org/dist/jakarta/velocity/binaries/velocity-1.4/">here</a>.
+formats, and can be found <a href="http://www.apache.org/dist/jakarta/velocity/binaries/velocity-1.4/">here</a>.
 </p>
 
 <p>
@@ -221,15 +65,16 @@
 
 </section>
 
+
 <section name="Where do I get nightly snapshots?">
 
 <p>
-    Nightly snapshots of the Velocity CVS can be found
-    <a href="http://cvs.apache.org/snapshots/velocity/">here</a>.
+    Nightly snapshots of the Velocity subversion source code tree can be found
+    <a href="http://svn.apache.org/snapshots/velocity/">here</a>.
 </p>
 
 <p>
-These are meant to provide easy access to the actual project CVS tree.
+These are meant to provide easy access to the actual project source control tree.
 As this is our live development workspace, there are no guarantees as to
 what you will find there,although we do our best to maintain a buildable
 source tree. If you are looking for the stable supported release, please
@@ -238,7 +83,7 @@
 
 <p>
 If you are willing to risk getting dirty, we invite you to try the
-nightly snapshot to see the current state of affairs (and help out!) <a
+nightly snapshot to see the current state of affairs. (and help out!) <a
 href="http://www.apache.org/dev/version-control.html">Public Subversion
 access</a> is also available.
 </p>
@@ -255,13 +100,13 @@
 </p>
 
 <ul>
-    <li>
-        There is a list of <a href="contributors.html">Active Developers</a>.
-        Submit some code and get your name added!</li>
-    <li>
-        Discussion occurs on the <a
+    <li>Report bugs, ask questions, and help new users on the <a
         href="http://jakarta.apache.org/getinvolved/mail.html">Velocity
-        mailing list</a>.</li>
+        mailing lists</a>.</li>
+    <li>There's a list of issues waiting to be addressed in 
+        <a href="http://issues.apache.org/bugzilla">Bugzilla</a>.</li>
+    <li>The Wiki has a large collection of community written content.  Add your
+        own article or contribute to the FAQ!</li>    
     <li>
         Access to the Subversion <strong>jakarta-velocity</strong> repository is available both
         <a href="http://svn.apache.org/repos/asf/jakarta/velocity/trunk/">online</a>

Added: jakarta/velocity/core/trunk/xdocs/overview.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/overview.xml?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/overview.xml (added)
+++ jakarta/velocity/core/trunk/xdocs/overview.xml Mon Jul 11 11:03:17 2005
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+
+<document>
+
+ <properties>
+  <title>Velocity Overview</title>
+  <author email="wglass@apache.org">Velocity Documentation Team</author>
+ </properties>
+
+ <body>
+
+
+ <section name="Overview">
+
+ <p>
+    Velocity is a template engine that can be used for many purposes.  Some common types of applications
+    which use Velocity are:
+ </p>
+    <ul>
+        <li>Web applications.  Web designers create HTML pages with placeholders for dynamic information.  
+           The page is processed with <a href="">VelocityViewServlet</a> or any of a 
+           number of <a href="">frameworks</a> which support Velocity.  This approach to web application development
+           is called Model-View-Controller or MVC and is intended to be a direct replacement
+           for applications developed with Java Server Pages (JSPs) or PHP.
+        </li>
+        
+        <li>Source code generation.  Velocity can be used to generate Java source code, SQL, or PostScript
+            based on templates.  The <a href="">Powered by</a> page lists a number of open source 
+            and commercial development software packages which use Velocity in this manner.
+        </li>
+            
+        <li>Automatic emails.  Many applications generate automatic emails for account signup, password reminders
+            or automatically sent reports.  Using Velocity, the email template can be stored in a text
+            file rather than directly embedded in your Java code.
+        </li>
+            
+        <li>XML transformation.  Velocity provides an ant task called <a href="anakia.html">Anakia</a> which reads
+            an XML file and makes it available to a Velocity template.  A common application is to
+            convert documentation stored in a generic "xdoc" format into a styled HTML document.
+         </li>
+    </ul>
+ </section>
+ 
+ 
+ <section name="How it Works">
+ <p>
+    Velocity allows web page designers and other template writers to include markup statements 
+    called <em>references</em> in the page.  These references are pulled from a <em>Context</em>
+    object --essentially a hashtable that provides get and set
+    methods for retrieving and setting objects --and the corresponding values are inserted 
+    directly in a page.  Velocity provides basic control statements, that can loop over a collection
+    of values (foreach) or conditionally show a block of text (if/else).  The ability to
+    call arbitrary Java methods, include other files, and to create macros that can be repeatedly
+    used make this a powerful yet easy-to-use approach for creating dynamic web page or other 
+    text files.
+ </p>
+  
+ <p>
+    Velocity enforces a Model-View-Controller (MVC) style of development
+    by separating Java code from HTML template code. Unlike JSPs,
+    Velocity does not allow Java code to be embedded in pages. Unlike PHP,
+    Velocity does not implement features with other functions. The MVC
+    approach is one of Velocity's great strengths, and allows for more
+    maintainable and better-designed web pages.
+ </p>
+
+ <p>
+    Although MVC-style development can sometimes lead to longer incubation
+    periods for web sites, particularly if the developers involved are new
+    to MVC, this approach saves time over the long term (believe us, we have
+    been doing this for a long time now). The MVC abstraction prevents web page
+    designers from messing with a software engineer's Java code, and
+    programmers from unduly influencing the look of web sites. Velocity enforces
+    a contract that defines what roles people play in the web site development
+    process.
+ </p>
+ </section>
+    
+
+ <section name="Extending Velocity's Capability">
+    <p>While Velocity is generally useful within an application as is, there are a number of ways
+    it's capabilities can be extended.
+    </p>
+    
+    <ul>
+        <li>Special types of objects, generically called "Tools", contain methods but no data.
+            When placed into the Velocity context the template can call these methods to 
+            do basic tasks like formatting numbers or escaping HTML entities.
+        </li>
+        <li>
+            Velocity provides a selection of <em>resource loaders</em> that can retrieve
+            templates from text files, the classpath, even a database.  But if that's not
+            enough you can write your own resource loader to retrieve in a custom manner.
+        </li>
+        <li>
+            <em>Event Handlers</em> provide hooks to perform custom actions upon certain 
+            events, such as the insertion of a reference into text.
+        </li>
+        <li>
+            Advanced users can write a custom <em>Introspector</em> which retrieves
+            reference properties and methods.  For example, you might create an introspector
+            that retrieves data from Lucene or other search engine indexes.
+        </li>
+        <li>Finally, for the truly adept, the grammer for Velocity is processed in a parser
+            generated by   
+            <a href="http://www.metamata.com/javacc/">JavaCC</a> (Java Compiler
+            Compiler) using the JJTree extension to create an Abstract Syntax Tree.
+            By changing the JavaCC specification file and recompiling, the Velocity syntax
+            itself can be changed.
+        </li>
+     </ul>
+
+ </section>
+
+ <section name="Acknowledgement">
+    <p>
+        Velocity's design concept is borrowed from <a
+        href="http://www.webmacro.org/">WebMacro</a>. Those involved in the
+        Velocity project acknowledge and appreciate the development and design work
+        that went into the WebMacro project.
+     </p>
+
+ </section>
+
+</body>
+</document>

Added: jakarta/velocity/core/trunk/xdocs/site.css
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/site.css?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/site.css (added)
+++ jakarta/velocity/core/trunk/xdocs/site.css Mon Jul 11 11:03:17 2005
@@ -0,0 +1,260 @@
+/*
+
+## Copyright 1999-2004 The Apache Software Foundation
+## 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.
+
+*/
+
+
+/** defined standard tags **/
+body {
+	background-color: #ffffff;
+	color: #000000;
+}
+
+a:link, a:active, a:visited {
+    color: #525D76;
+}
+
+
+h1 {
+	background-color: #525D76;
+	color: #ffffff;
+	font-family: arial,helvetica,sanserif;
+	font-size: large;
+	padding-left:2px;
+}
+
+h2 {
+	background-color: #828DA6;
+	color: #ffffff;
+	font-family: arial,helvetica,sanserif;
+	font-size: medium;
+	padding-left:2px;
+}
+
+table {
+	border: none;
+	border-spacing:0px;
+	border-collapse: collapse;
+}
+
+img {
+	border: none 0px;
+}
+
+/** define layout **/
+
+/** table used to force footer to end of page **/
+table#layout {
+	width:100%;
+}
+
+table#layout td {
+	padding:0px;
+}
+
+div#container {
+
+	/** IE **/
+	height:100%;
+
+	/** Firefox - need to adjust if menu length changes **/
+	min-height:1000px;
+}
+
+div#header {
+	margin-left:5px;
+	margin-top:10px;
+	margin-bottom:10px;
+	width: 825px;
+	height:80px;
+	border-bottom: 1px solid #333333;
+}
+
+div#body {
+	left:0px;
+	top:0px;
+	margin-left:225px;
+	width: 600px; 
+}
+
+
+div#menu {
+	float:left;
+	width: 200px; 
+	margin-left:5px;
+}
+
+div#footer {
+	padding-top:15px;
+	margin-top:25px;
+	border-top: 1px solid #333333;
+
+	text-align:center;
+	color: #525D76;
+	font-style: italic;
+	font-size: smaller;
+}
+
+div#logo1 {
+	float:left;
+	margin-left:5px;
+	margin-top:10px;
+}
+
+
+div#logo2 {
+	float:right;
+	margin-top:10px;
+}
+
+
+/** define body tag redefinitions **/
+
+
+div#body th {
+	background-color: #039acc;
+	color: #000000;
+	font-family: arial,helvetica,sanserif;
+	font-size: smaller;	
+	vertical-align: top;
+	text-align:left;
+	border:1px #FFFFFF solid;
+	padding: 2px;	
+}
+
+div#body td {
+	background-color: #a0ddf0;
+	color: #000000;
+	font-family: arial,helvetica,sanserif;
+	font-size: smaller;	
+	vertical-align: top;
+	text-align:left;
+	border:1px #FFFFFF solid;
+	padding: 2px;	
+}
+
+
+div#body li {
+	 margin-top:3px;
+}
+
+/** define other body styles **/
+
+div.section {
+	margin-left: 25px;	
+}
+
+div.subsection {
+	margin-left: 25px;	
+}
+
+div.source {
+	margin-left:25px;
+	margin-top:20px;
+	margin-bottom:20px;
+	padding-left:4px;
+	padding-right:4px;
+	padding-bottom:4px;
+	padding-top:5px;
+	
+	width:575px;
+
+	border: 1px solid #333333;
+	background-color: #EEEEEE;
+	color: #333333;
+
+	/** puts a space before or after the block in IE and FireFox **/
+	white-space: pre;
+
+	font-family: Courier;
+	font-size: smaller;
+	text-align: left;
+	
+	overflow:auto;
+}
+
+
+/** define menu styles **/
+
+div.menusection {
+	margin-bottom:10px;
+}
+
+.menuheader {
+	font-weight:bold;
+	margin-bottom:0px;
+}
+
+div.menusection ul {
+	margin-top:5px;
+
+}
+div.menusection li {
+
+}
+
+
+
+
+/** printing **/
+@page Section1
+    {
+    size:8.5in 11.0in;
+    margin:1.0in .75in 1.0in .75in;
+}
+
+@media print {
+	div#container {
+
+		min-height:0px;
+	}
+
+
+	div#menu {
+		display:none;
+	}
+	
+	div#header {
+		display:none;
+	}
+	
+	div#body {
+		margin-left:5px;
+	}
+	
+	h1 {
+		background-color: #FFFFFF;
+		color: #000000;
+	}			
+
+	h2 {
+		background-color: #FFFFFF;
+		color: #000000;
+	}			
+
+	div#body td {
+		background-color: #FFFFFF;
+		color: #000000;
+		border: #333333 1px solid;
+	}
+
+	div#body th {
+		background-color: #FFFFFF;
+		color: #000000;
+		border: #333333 1px solid;
+		font-style:bold;
+	}
+
+}
\ No newline at end of file

Modified: jakarta/velocity/core/trunk/xdocs/stylesheets/project.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/stylesheets/project.xml?rev=210169&r1=210168&r2=210169&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/stylesheets/project.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/stylesheets/project.xml Mon Jul 11 11:03:17 2005
@@ -1,60 +1,59 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <project name="Velocity"
-        href="http://jakarta.apache.org/velocity/">
+          href="http://jakarta.apache.org/velocity/">
 
     <title>Velocity</title>
-    <logo href="/images/logo.gif">Velocity</logo>
+    <logo   href="/images/newlogo.png">Velocity</logo>
 
     <body>
-    <menu name="About">
-        <item name="Overview"               href="/index.html"/>
-        <item name="Getting Started"        href="/getting-started.html"/>
-        <item name="Download"               href="http://jakarta.apache.org/builds/jakarta-velocity/"/>
-        <item name="Install"                href="/install.html"/>
-        <item name="Design"                 href="/design.html"/>
-        <item name="Contributors"           href="/contributors.html"/>
-        <item name="ChangeLog"              href="/changes.html"/>
-        <item name="Coding Standards"       href="/code-standards.html"/>
-        <item name="License"                href="/license.html"/>
-        <item name="TODO"                   href="/todo.html"/>
-        <item name="Report Issues"          href="http://issues.apache.org/bugzilla/enter_bug.cgi?product=Velocity"/>
+    <menu name="Velocity">
+        <item name="Home"                     href="/index.html"/>
+        <item name="Overview"                 href="/overview.html"/>
+        <item name="Getting Started"          href="/getting-started.html"/>
+        <item name="Web Applications"         href="/webapps.html"/>
+        <item name="Download"                 href="http://jakarta.apache.org/site/downloads/downloads_velocity.html"/>
+        <item name="FAQ (Wiki)"               href="http://wiki.apache.org/jakarta-velocity/VelocityFAQ"/>
+    </menu>
+    <menu name="Docs (Velocity 1.4)">
+        <item name="User's Guide"             href="/docs14/user-guide.html"/>
+        <item name="Developer's Guide"        href="/docs14/developer-guide.html"/>
+        <item name="VTL Reference Guide"      href="/docs14/vtl-reference-guide.html"/>
+        <item name="Anakia : XML->doc tool"   href="/docs14/anakia.html"/>
+        <item name="Texen : text generation"  href="/docs14/texen.html"/>
+        <item name="Veltag : JSP taglib"      href="/docs14/veltag.html"/>
+        <item name="Javadoc"                  href="/docs14/api/index.html"/>
+        <item name="Change Log"               href="/docs14/changes.html"/>
+        <item name="License"                  href="/docs14/license.html"/>
+    </menu>
+    <menu name="Sub Projects">
+        <item name="Velocity Tools"           href="/tools/index.html"/>
+        <item name="DVSL : XML transformation"  href="/dvsl/index.html"/>
     </menu>
     <menu name="Community">
-        <item name="Powered By Velocity"    href="/powered.html"/>
-        <item name="Get Involved"           href="/site/getinvolved.html"/>
-        <item name="Mailing Lists"          href="/site/mail.html"/>
-        <item name="Subversion Repositories" href="http://www.apache.org/dev/version-control.html"/>
-    </menu>
-    <menu name="Docs">
-        <item name="User's Guide (English)" href="/user-guide.html"/>
-        <item name="User's Guide (Finnish)" href="/user-guide_fi.html"/>
-        <item name="User's Guide (French)"  href="/user-guide_fr.html"/>
-        <item name="User's Guide (Spanish)" href="/user-guide_es.html"/>
-        <item name="Developer's Guide"      href="/developer-guide.html"/>
-        <item name="VTL Reference Guide"    href="/vtl-reference-guide.html"/>
-        <item name="Specification"          href="/specification.html"/>
-        <item name="Javadoc"                href="/api/index.html"/>
-        <item name="Wiki"                   href="http://wiki.apache.org/jakarta-velocity/"/>
-        <item name="FAQ"                    href="http://wiki.apache.org/jakarta-velocity/VelocityFAQ"/>
-    </menu>
-    <menu name="Tools">
-        <item name="Velocity Tools"         href="/tools/index.html"/>
-        <item name="Anakia : XML->doc tool" href="/anakia.html"/>
-        <item name="Texen : text generation"                  href="/texen.html"/>
-        <item name="DVSL : XML xformation"                   href="/dvsl/index.html"/>
-        <item name="Veltag : JSP taglib"    href="/veltag.html"/>
-        <item name="Migration to Velocity"  href="/migration.html"/>
-        <item name="Editors and IDEs"       href="/devtools.html"/>
-    </menu>
-    <menu name="Comparisons">
-        <item name="YMTD"                   href="/ymtd/ymtd.html"/>
-        <item name="VM/WM Differences"      href="/differences.html"/>
-        <item name="JSP vs. Velocity"       href="/casestudy1.html"/>
-        <item name="XMLC vs. Velocity"      href="/casestudy2.html"/>
-    </menu>
-    <menu name="Site Translations">
-        <item name="English"                 href="http://jakarta.apache.org/velocity/"/>
-        <item name="Japanese"                href="http://www.jajakarta.org/velocity/"/>
+        <item name="Wiki"                     href="http://wiki.apache.org/jakarta-velocity/"/>
+        <item name="Recent News"              href="http://wiki.apache.org/jakarta-velocity/VelocityNews"/>
+        <item name="Powered By Velocity"      href="http://wiki.apache.org/jakarta-velocity/PoweredBy"/>
+        <item name="IDE/Editor Plugins"       href="http://wiki.apache.org/jakarta-velocity/DevTools"/>
+        <item name="Articles and Books"       href="http://wiki.apache.org/jakarta-velocity/Articles"/>
+        <item name="Get Involved"             href="http://wiki.apache.org/jakarta-velocity/GetInvolved"/>
+        <item name="Mailing Lists"            href="http://jakarta.apache.org/site/mail.html"/>
+    </menu>
+    <menu name="Developers">
+        <item name="Source Code Repository"   href="http://www.apache.org/dev/version-control.html"/>
+        <item name="Building from Source"     href="/build.html"/>
+        <item name="Nightly Snapshots"        href="http://cvs.apache.org/snapshots/velocity/"/>
+        <item name="Road Map"                 href="http://wiki.apache.org/jakarta-velocity/RoadMap"/>
+        <item name="Coding Standards"         href="http://wiki.apache.org/jakarta-velocity/CodeStandards"/>    
+        <item name="Documentation Guidelines" href="http://wiki.apache.org/jakarta-velocity/DocumentationGuidelines"/>    
+        <item name="Issues"                   href="http://issues.apache.org/bugzilla/enter_bug.cgi?product=Velocity"/>
+        <item name="List of Committers"       href="/committers.html"/>
+    </menu>
+    <menu name="Translations">
+        <item name="Site (Japanese)"          href="http://www.jajakarta.org/velocity/"/>
+        <item name="User's Guide (Finnish)"   href="/translations/user-guide_fi.html"/>
+        <item name="User's Guide (French)"    href="/translations/user-guide_fr.html"/>
+        <item name="User's Guide (Spanish)"   href="/translations/user-guide_es.html"/>
     </menu>
     </body>
 </project>
+

Modified: jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl?rev=210169&r1=210168&r2=210169&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl (original)
+++ jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl Mon Jul 11 11:03:17 2005
@@ -14,20 +14,6 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-
-
-<!-- Content Stylesheet for Site -->
-
-    ## Defined variables
-    #set ($bodybg = "#ffffff")
-    #set ($bodyfg = "#000000")
-    #set ($bodylink = "#525D76")
-    #set ($bannerbg = "#525D76")
-    #set ($bannerfg = "#ffffff")
-    #set ($subbannerbg = "#828DA6")
-    #set ($subbannerfg = "#ffffff")
-    #set ($tablethbg = "#039acc")
-    #set ($tabletdbg = "#a0ddf0")
     
 <!-- start the processing -->
 #document()
@@ -64,14 +50,10 @@
 #if ($value.getAttributeValue("rowspan"))
 #set ($rowspan = $value.getAttributeValue("rowspan"))
 #end
-<td bgcolor="$tabletdbg" colspan="$!colspan" rowspan="$!rowspan" valign="top" align="left">
-    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+<td colspan="$!colspan" rowspan="$!rowspan">
         #if ($value.getText().length() != 0 || $value.hasChildren())
         $value.getContent()
-        #else
-        &nbsp;
         #end
-    </font>
 </td>
 #end
 
@@ -82,14 +64,10 @@
 #if ($value.getAttributeValue("rowspan"))
 #set ($rowspan = $value.getAttributeValue("rowspan"))
 #end
-<th bgcolor="$tablethbg" colspan="$!colspan" rowspan="$!rowspan" valign="top" align="left">
-    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
-        #if ($value.getText().length() != 0 || $value.hasChildren())
-        $value.getContent()
-        #else
-        &nbsp;
-        #end
-    </font>
+<th colspan="$!colspan" rowspan="$!rowspan">
+	#if ($value.getText().length() != 0 || $value.hasChildren())
+	$value.getContent()
+	#end
 </th>
 #end
 
@@ -122,116 +100,115 @@
 #end
 
 #macro ( source $value)
-    <div align="left">
-    <table cellspacing="4" cellpadding="0" border="0">
-    <tr>
-      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-    </tr>
-    <tr>
-      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-      <td bgcolor="#ffffff"><pre>$escape.getText($value.getText())</pre></td>
-      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-    </tr>
-    <tr>
-      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
-    </tr>
-    </table>
-    </div>
+<div class="source">$escape.getText($value.getText())</pre></div>
 #end
 
-#macro ( subsection $subsection)
-    <table border="0" cellspacing="0" cellpadding="2" width="100%">
-      <tr><td bgcolor="$subbannerbg">
-        <font color="$subbannerfg" face="arial,helvetica,sanserif">
-          <a name="$subsection.getAttributeValue("name")"><strong>$subsection.getAttributeValue("name")</strong></a>
-        </font>
-      </td></tr>
-      <tr><td>
-        <blockquote>
-        #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
-        </blockquote>
-      </td></tr>
-      <tr><td><br/></td></tr>
-    </table>
+
+## need these to catch special macros within lists
+#macro(list $node)
+<$node.getName()>
+	#foreach ( $items in $node.getChildren() )
+		#listitem($items)
+	#end
+</$node.getName()>
+#end
+
+#macro (listitem $node)
+<$node.getName()>
+## use getContent instead of getChildren 
+## to include both text and nodes
+	#foreach ( $items in $node.getContent() )
+		#if($items.name)
+			#display($items)
+		#else
+			$items.value
+		#end
+	#end
+</$node.getName()>
+#end
+
+
+### displays a basic node, calling macros if appropriate
+#macro ( display $node )
+		#if ($node.getName().equals("img"))
+			#image ($node)
+		#elseif ($node.getName().equals("source"))
+			#source ($node)
+		#elseif ($node.getName().equals("table"))
+			#table ($node)
+		#elseif ($node.getName().equals("ul"))
+			#list ($node)
+		#elseif ($node.getName().equals("ol"))
+			#list ($node)
+		#else
+			$node
+		#end
 #end
 
 #macro ( section $section)
-    <table border="0" cellspacing="0" cellpadding="2" width="100%">
-      <tr><td bgcolor="$bannerbg">
-        <font color="$bannerfg" face="arial,helvetica,sanserif">
-          <a name="$section.getAttributeValue("name")"><strong>$section.getAttributeValue("name")</strong></a>
-        </font>
-      </td></tr>
-      <tr><td>
-        <p>
-        <blockquote>
-        #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
-        </blockquote>
-        </p>
-      </td></tr>
-      <tr><td><br/></td></tr>
-    </table>
+	<a name="$section.getAttributeValue("name")"></a>
+	<h1>$section.getAttributeValue("name")</h1>
+
+	<div class="subsection">
+		#foreach ( $items in $section.getChildren() )
+			#if ($items.getName().equals("subsection"))
+				#subsection ($items)
+			#else
+				#display($items)
+			#end
+		#end
+	</div>
+#end
+
+#macro ( subsection $subsection)
+	<a name="$subsection.getAttributeValue("name")"></a>
+	<h2>$subsection.getAttributeValue("name")</h2>
+	<div class="subsection">
+		#foreach ( $items in $subsection.getChildren() )
+			#display($items)
+		#end
+	</div>
 #end
 
+
 #macro ( makeProject )
 
     <!-- ============================================================ -->
 
     #set ($menus = $project.getChild("body").getChildren("menu"))
     #foreach ( $menu in $menus )
-        <p><strong>$menu.getAttributeValue("name")</strong></p>
-        <ul>
-        #foreach ( $item in $menu.getChildren() )
-            #set ($name = $item.getAttributeValue("name"))
-            <li>#projectanchor($name $item.getAttributeValue("href"))</li>
-        #end
-        </ul>
+    	<div class="menusection">
+    		<span class="menuheader">$menu.getAttributeValue("name")</span>
+			<ul>
+			#foreach ( $item in $menu.getChildren() )
+				#set ($name = $item.getAttributeValue("name"))
+				<li>#projectanchor($name $item.getAttributeValue("href"))</li>
+			#end
+			</ul>
+        </div>
     #end
 #end
 
 #macro (getProjectImage)
+
+<div id="logo1">
+	<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</div>
+
+
 #if ($project.getChild("logo"))
-<td align="left">
-<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
-</td>
-<td align="right">
+
+<div id="logo2">
+
 #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
-</td>
-#else
-<td colspan="2">
-<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
-</td>
+
+</div>
+
 #end
 #end
 
@@ -267,48 +244,36 @@
             #end
 
             <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
+			<link rel="stylesheet" href="${relativePath}/site.css" type="text/css">
         </head>
 
-        <body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">        
-            <table border="0" width="100%" cellspacing="0">
-                <!-- TOP IMAGE -->
-                <tr>
-                    #getProjectImage()
-                </tr>
-            </table>
-            <table border="0" width="100%" cellspacing="4">
-                <tr><td colspan="2">
-                    <hr noshade="" size="1"/>
-                </td></tr>
-                
-                <tr>
-                    <!-- LEFT SIDE NAVIGATION -->
-                    <td width="20%" valign="top" nowrap="true">
-                    #makeProject()
-                    </td>
-                    <td width="80%" align="left" valign="top">
-                    #set ($allSections = $root.getChild("body").getChildren("section"))
-                    #foreach ( $section in $allSections )
-                        #section ($section)
-                    #end
-                    </td>
-                </tr>
-
-                <!-- FOOTER -->
-                <tr><td colspan="2">
-                    <hr noshade="" size="1"/>
-                </td></tr>
-                <tr><td colspan="2">
-                    <div align="center"><font color="$bodylink" size="-1"><em>
-                    Copyright &#169; 1999-2005, The Apache Software Foundation
-                    </em></font></div>
-                </td></tr>
-            </table>
+        <body>        
+
+			## use a table in order to force footer to end of page
+						
+				<div id="header">
+					#getProjectImage()
+				</div>
+
+			<div id="container">
+
+				<div id="menu">
+					#makeProject()			
+				</div>
+
+				<div id="body">
+					#set ($allSections = $root.getChild("body").getChildren("section"))
+					#foreach ( $section in $allSections )
+						#section ($section)
+					#end			
+				</div>
+
+			</div>
+
+			<div id="footer">
+				Copyright &#169; 1999-2005, The Apache Software Foundation
+			</div>
+			
         </body>
     </html>
 #end
-
-
-
-
-

Added: jakarta/velocity/core/trunk/xdocs/stylesheets/wiki.vsl
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/stylesheets/wiki.vsl?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/stylesheets/wiki.vsl (added)
+++ jakarta/velocity/core/trunk/xdocs/stylesheets/wiki.vsl Mon Jul 11 11:03:17 2005
@@ -0,0 +1,112 @@
+## Copyright 1999-2004 The Apache Software Foundation
+## 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.
+
+## authored by Will Glass-Husain, wglass@apache.org
+## note: this is entirely experimental.
+
+
+## START THE PROCESSING
+
+#document()
+
+## END THE PROCESSING
+
+
+##################################################################################################
+#macro ( image $value )$value.getAttributeValue("src")#end
+
+##################################################################################################
+#macro ( imageurl $value )$value#end
+
+##################################################################################################
+## implements simple hierarchal tables
+## Doesn't really work right now
+
+#macro ( table $node )
+#foreach ( $items in $node.Children)#if ($items.Name.equalsIgnoreCase("TR"))#tablerow($items)#end#end#end
+
+#macro (tablerow $node)
+
+#foreach ( $items in $node.getChildren())#if ($items.Name.equalsIgnoreCase("TD"))| #parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("th"))| <B>#parsecontent($items.content)</B>#end#end#end
+
+
+
+
+##################################################################################################
+#macro ( source $value)
+{{{$escape.getText($value.getText())
+}}}
+#end
+
+##################################################################################################
+#macro ( code $value)
+{{{$escape.getText($value.getText())}}}
+#end
+
+##################################################################################################
+#macro ( subsection $subsection)
+
+=== $subsection.getAttributeValue("name") ===
+#parsecontent($subsection.getChildren())
+#end
+
+##################################################################################################
+#macro ( section $section)
+
+== $section.getAttributeValue("name") ==
+#parsecontent($section.getChildren())
+#end
+
+##################################################################################################
+#macro ( paragraph $node)
+
+#parsecontent($node.content)
+#end
+
+##################################################################################################
+#macro ( font $node)#parsecontent($node.content)#end
+
+##################################################################################################
+#macro ( link $node)[$!node.getAttribute("href").Value$!node.getAttribute("HREF").Value $node.Text]#end
+
+##################################################################################################
+#macro ( unorderedlist $node)
+#foreach ( $items in $node.getChildren())
+#if ($items.getName().equalsIgnoreCase("LI"))* #parsecontent($items.content)#end#end#end
+
+##################################################################################################
+#macro ( orderedlist $node)
+#foreach ( $items in $node.getChildren())
+#if ($items.getName().equalsIgnoreCase("LI"))# #parsecontent($items.content)#end#end#end
+
+##################################################################################################
+#macro (parsecontent $children)#foreach ( $items in $children )#if ($items.getName().equalsIgnoreCase("img"))#image ($items)#elseif ($items.getName().equalsIgnoreCase("code"))#code ($items) #elseif ($items.getName().equalsIgnoreCase("section"))#section ($items)#elseif ($items.getName().equalsIgnoreCase("subsection"))#subsection ($items)#elseif ($items.getName().equalsIgnoreCase("source"))#source ($items)#elseif ($items.getName().equalsIgnoreCase("table"))#table ($items)#elseif ($items.getName().equalsIgnoreCase("P"))#paragraph($items)#elseif ($items.getName().equalsIgnoreCase("UL"))#unorderedlist($items)#elseif ($items.getName().equalsIgnoreCase("OL"))#orderedlist($items)#elseif ($items.getName().equalsIgnoreCase("DIV"))#parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("FONT"))#font($items)#elseif ($items.getName().equalsIgnoreCase("A"))#link($items)#elseif ($items.getName().equalsIgnoreCase("I"))<I>#parsecontent($items.content)</I>#elseif ($items.getName().equalsIgnoreCase("EM"))<EM>#parsecontent($items.content)</EM>#elseif ($items.content)#parsecontent($items.content)#else#**#$items.Text#end#end#end
+
+##################################################################################################
+#macro (getProjectImage)#imageurl("http://jakarta.apache.org/images/jakarta-logo.gif")#end
+
+
+##################################################################################################
+#macro (document)
+
+## PAGE HEADER
+
+## DOCUMENT BODY
+
+## LOOP THROUGH ALL SECTIONS
+#set ($allSections = $root.getChild("body").getChildren("section"))#foreach ( $section in $allSections )#section ($section)#end
+
+## PAGE FOOTER
+##----
+
+#end

Added: jakarta/velocity/core/trunk/xdocs/webapps.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/webapps.xml?rev=210169&view=auto
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/webapps.xml (added)
+++ jakarta/velocity/core/trunk/xdocs/webapps.xml Mon Jul 11 11:03:17 2005
@@ -0,0 +1,328 @@
+<?xml version="1.0"?>
+
+<document>
+
+ <properties>
+  <title>Getting Started with a Web Application</title>
+  <author email="wglass@forio.com">Velocity Documentation Team</author>
+ </properties>
+
+<body>
+
+<section name="Building a Web Application with Velocity">
+
+<p>
+Velocity is often used to generate web pages in applications, usually as a direct replacement
+for JSP.  Some of the benefits of using Velocity to generate web pages are:
+</p>
+
+<ul>
+<li> <strong>Simple</strong> - Good for non-technical web designers.
+</li>
+
+<li> <strong>Easy to maintain</strong> - With the recommended MVC approach removes scripting from web pages.
+</li>
+
+<li> <strong>Methods and properties</strong> - Web designers can reference methods as well as properties of objects in context
+</li>
+
+<li> <strong>Consistent</strong> - Velocity can be used for other text generation tasks (such as sending email) providing a consistent way of marking up text.
+</li>
+</ul>
+
+<p>This document provides some basic info on getting started with Velocity in a web application.
+</p>
+
+</section>
+
+<section name="Use a Framework">
+
+<p>
+The primary purpose of the core Velocity engine is simply to generate text based on 
+a template.  Consequently, Velocity does not contain any web-related functionality in and off itself.  
+To make a web application you will need a <strong>framework</strong> to respond to HTTP requests, 
+handle user authentication, make business logic calls, and generate a response.  
+There are several strong contenders.
+</p>
+
+<ol>
+<li>  <strong>Velocity Tools / VelocityViewServlet</strong> -
+The easiest way to get started is to download the companion <a href="http://jakarta.apache.org/velocity/tools/">Velocity Tools</a> 
+subproject and use the 
+<a href="http://jakarta.apache.org/velocity/tools/view/">VelocityViewServlet</a>.  This servlet is easy to configure 
+and install.  You create a directory of templates on your web server, edit an XML file that lists various "Tools" to 
+place in the context and you are off.  More details are in the tutorial below.
+</li>
+
+<li>  <strong>Velocity Tools / VelocityStruts</strong> -
+You may be familiar with the popular <a href="http://struts.apache.org/">Struts</a> framework, originally designed to provide much needed
+application functionality to JSP.  With the <a href="http://jakarta.apache.org/velocity/tools/struts/">VelocityStruts</a>
+module of Velocity Tools you can substitute Velocity for JSP as the page template language.  This allows you 
+to take advantage of the large base of Struts infrastructure while designing pages using Velocity.
+</li>
+
+<li><strong>Third party frameworks</strong> - There are a number of third party frameworks listed on the 
+<a href="http://wiki.apache.org/jakarta-velocity/PoweredByVelocity">PoweredByVelocity</a>
+wiki page.  Of these, <a href="http://www.springframework.org/">Spring</a> is probably the most sophisticated and well known.
+<a href="http://jakarta.apache.org/turbine/">Jakarta Turbine</a> has many features and can also be very useful.  
+It was built with Velocity as the primary page language, which is not surprising since many of the original Velocity
+developers were involved in creating it.
+A simpler alternative is the <a href="http://mav.sourceforge.net/">Maverick</a> framework
+which provides a simple Controller architecture that integrates nicely with
+Velocity but has no bells or whistles.
+</li>
+
+<li><strong>Build your own</strong> - A final alternative is to build your own framework.  Create a dispatcher servlet,
+retrieve templates from a file or database, integate with your business logic and send the results back to the user.
+Often you'll have an easier time starting with one of the existing frameworks
+and customizing it.  In particular you can add new functionality to the VelocityViewServlet simply by creating a subclass.
+</li>
+</ol>
+
+<p>
+As a side note, you may also come across references to VelocityServlet, which is a deprecated servlet that was included in
+the Velocity Core up through version 1.4.  Since VelocityServlet is no longer being maintained we strongly recommend
+you use VelocityViewServlet in Velocity Tools instead.
+</p>
+
+</section>
+
+<section name="Web-Specific Issues">
+<p>
+There are a few issues with Velocity that are specific to web applications.  Here is a brief discussion of the most 
+commonly encountered issues.
+</p>
+
+<subsection name="Changing Object State - Don't!">
+<p>Velocity provides the ability to call any method of an object acting as a reference.  This can be useful when displaying 
+information into the page but is dangerous when object or application state is modified.
+</p>
+
+<p>
+For example,
+the following code safely calls the size() method of a list and displays the result.
+</p>
+
+<source><![CDATA[
+There are $users.size() currently logged in.
+]]></source>
+
+<p>
+As a bad example, a financial web page might include an object that calculates
+data year by year.  A method calculateNextYear() would calculate data for the next year and advance an internal counter.
+</p>
+
+<source><![CDATA[
+2005 data: $table.data
+$table.calculateNextYear()
+2006 data: $table.data
+]]></source>
+
+<p>The problem with this approach is that you can't repeat this code in multiple parts of the page.  You may not intend
+to do so, but it's easy to forget this when cutting and pasting or writing control statements (such as #if or #foreach).
+This gets much worse when you are dealing with application or session-level state.  
+</p>
+
+<p>The (strongly) recommended practice is
+to only use Velocity for inserting information into text.  Method calls can be useful to retrieve information.  However, it's generally a bad idea
+to use a method call to change object state, and it's always a bad idea to change application state.  
+</p>
+
+<p>If you find yourself needing to change object state (as in the previous example) try precalculating all the possible
+values in the controller and putting them in a List or Map.  Any changes to application state should always be
+done by the controller.
+</p>
+
+<p>On a related note, you should always put a List or Set into the context instead of an Iterator or Enumeration.  This allows the collection to 
+be used more than once in the page with no change in behavior.
+</p>
+
+</subsection>
+
+<subsection name="Escaping HTML/XML Entities">
+
+<p>
+Any user-entered text that contains special HTML or XML entities (such as &lt;, &gt;, or &amp;) needs to be escaped 
+before included in the web page.  This is required both to ensure the text is visible and also to prevent
+dangerous <a href="http://en.wikipedia.org/wiki/Cross_site_scripting">cross-site scripting</a>.  
+Unlike (for example) JSP's JSTL (Java Standard Tag Language), 
+Velocity does not contain any HTML-specific escaping functionality.  However, you have three options.
+</p>
+
+<ol>
+<li>Create a special "Tool" (an object in the context) with a method that performs escaping, for example
+$escape.html($usertext).  This is conceptually the easiest way to solve this problem.
+</li>
+<li>Create a custom <a href="http://wiki.apache.org/jakarta-velocity/HackingVelocity">ReferenceInsertionEventHandler</a> that automatically escapes every reference.
+If all references need to be escaped, this is the most painless method.
+</li>
+<li>Create a <a href="http://wiki.apache.org/jakarta-velocity/HackingVelocity">custom directive</a> (e.g. #escape) that escapes all text within the directive block.
+</li>
+</ol>
+
+<p>
+Note that other kinds of escaping are sometimes required.  For example, in style sheets the @ character needs
+to be escaped, and in Javascript strings the single apostrophe ' needs to be escaped.
+</p>
+
+</subsection>
+
+<subsection name="Securing the Application">
+
+<p>
+Since a web application is running on a central server that typically has multiple users and confidential resources, 
+care must be taken to make the web application is secure.  Most standard web security principles apply to a 
+web application built with Velocity.  A few specific issues (such as system configuration, more on cross-site scripting, 
+and method introspection) are written up in this article on 
+<a href="http://wiki.apache.org/jakarta-velocity/BuildingSecureWebApplications">Building Secure Applications with Velocity</a>.
+</p>
+
+</subsection>
+
+<subsection name="Log Files">
+
+<p>
+A minor point is that Velocity (in the absence of any log-related configuration) creates a log file in the current directory.  
+When Velocity is used in a web application the "current directory" is usually the current directory when the application
+server is started.  If you start seeing the file "velocity.log" files in random places on your server filesystem check
+the Velocity log configuration.  Typically this occurs when Velocity is used within a web application outside of web page
+generation (e.g. for sending email).
+</p>
+
+</subsection>
+
+
+</section>
+
+<section name="Tutorial">
+
+<p>
+What follows is a brief tutorial on building a simple web app with VelocityViewServlet.  For more information, consult the 
+<a href="http://jakarta.apache.org/velocity/tools/">Velocity Tools</a> documentation.
+</p>
+
+<ol>
+<li>Download the Velocity Tools project source (you need the source for the examples)
+from <a href="http://jakarta.apache.org/site/downloads/">here</a>.  
+</li>
+
+<li>If you haven't already installed <a href="http://ant.apache.org/">Apache Ant</a>. do so now.
+</li>
+
+<li> Build the Velocity Tools jar and the "simple" example by typing:
+<source><![CDATA[
+ant example.simple
+]]></source>
+</li>
+
+<li>Take a look at the "examples" directory.  You will see a file "index.vm".  Here's an excerpt:
+
+<source><![CDATA[
+<html>
+<body>
+I'm a velocity template.
+
+#if( $XHTML )
+  #set( $br = "<br />" )
+#else
+  #set( $br = "<br>" )
+#end
+
+$br
+$br
+
+Here we use a custom tool: $toytool.message
+
+$br
+$br
+
+Here we get the date from the DateTool:  $date.medium
+</body>
+</html>
+]]></source>
+
+
+You can copy any additional velocity files
+into this same directory.  In examples/WEB-INF you will see a file "toolbox.xml".  This specifies a list of "Tools" 
+that are automatically included in the context.  
+
+<source><![CDATA[
+<toolbox>
+  <xhtml>true</xhtml>
+  <tool>
+     <key>toytool</key>
+     <class>ToyTool</class>
+  </tool>
+  <data type="number">
+    <key>version</key>
+    <value>1.1</value>
+  </data>
+  <data type="boolean">
+    <key>isSimple</key>
+    <value>true</value>
+  </data>
+  <data type="string">
+    <key>foo</key>
+    <value>this is foo.</value>
+  </data>
+  <data type="string">
+    <key>bar</key>
+    <value>this is bar.</value>
+  </data>
+  <tool>
+    <key>map</key>
+    <class>java.util.HashMap</class>
+  </tool>
+  <tool>
+    <key>date</key>
+    <scope>application</scope>
+    <class>org.apache.velocity.tools.generic.DateTool</class>
+  </tool>
+</toolbox>
+]]></source>
+
+And finally the web.xml file specifies the name of the servlet and location of toolbox.properties.
+<source><![CDATA[
+<web-app>
+  <servlet>
+    <servlet-name>velocity</servlet-name>
+    <servlet-class>
+        org.apache.velocity.tools.view.servlet.VelocityViewServlet
+    </servlet-class>
+    <init-param>
+      <param-name>org.apache.velocity.toolbox</param-name>
+      <param-value>/WEB-INF/toolbox.xml</param-value>
+    </init-param>
+    <load-on-startup>10</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>velocity</servlet-name>
+    <url-pattern>*.vm</url-pattern>
+  </servlet-mapping>
+  <welcome-file-list>
+    <welcome-file>index.vm</welcome-file>
+  </welcome-file-list>
+</web-app>
+]]></source>
+
+</li>
+<li>Copy this directory into your "webapps" directory on Tomcat.  You could also copy "simple.war", but copying in the entire directory
+will let you experiment with changes.  You should now be able to access your simple one-page webapp with this URL.  (or something similar)
+
+<source><![CDATA[
+http://localhost:8080/simple/index.vm
+]]></source>
+
+</li>
+<li>Experiment with adding new Velocity pages.  Note that you can access any velocity page just by changing the URL.  Try changing the
+entries in toolbox.xml or creating your own tools.  Consult the <a href="http://jakarta.apache.org/velocity/tools/">Velocity Tools</a> 
+documentation and the <a href="http://wiki.apache.org/jakarta-velocity/">Wiki</a> for more info on the wide variety of tools available.
+</li>
+</ol>
+
+</section>
+
+
+
+</body>
+</document>
\ No newline at end of file



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