You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/05/25 04:18:11 UTC

svn commit: rev 20426 - in avalon/trunk: central/site central/site/src/xdocs/planet/components central/site/src/xdocs/planet/facilities central/system central/system/themes/avalon2/html tools/project/src/main/org/apache/avalon/tools/home tools/project/src/main/org/apache/avalon/tools/tasks

Author: mcconnell
Date: Mon May 24 19:18:11 2004
New Revision: 20426

Added:
   avalon/trunk/central/site/build.xml
   avalon/trunk/central/site/src/xdocs/planet/components/connection.xml
   avalon/trunk/central/site/src/xdocs/planet/components/datasource.xml
   avalon/trunk/central/site/src/xdocs/planet/components/index.xml
   avalon/trunk/central/site/src/xdocs/planet/components/navigation.xml
   avalon/trunk/central/site/src/xdocs/planet/components/scheduler.xml
   avalon/trunk/central/site/src/xdocs/planet/components/sockets.xml
   avalon/trunk/central/site/src/xdocs/planet/components/store.xml
   avalon/trunk/central/site/src/xdocs/planet/components/threads.xml
   avalon/trunk/central/system/index.xml
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/XdocTask.java
Modified:
   avalon/trunk/central/site/src/xdocs/planet/facilities/navigation.xml
   avalon/trunk/central/system/themes/avalon2/html/transform.xsl
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java
Log:
add corhnerstone content and central build support

Added: avalon/trunk/central/site/build.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/build.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,9 @@
+
+<project name="site" default="" basedir="." 
+    xmlns:x="antlib:org.apache.avalon.tools"> 
+
+  <x:project index="../system/index.xml"/>
+  <x:prepare/>
+  <x:xdoc/>
+
+</project>

Added: avalon/trunk/central/site/src/xdocs/planet/components/connection.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/connection.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Connection</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Connection">
+      <subsection name="Description">
+            <p>
+            The ConnectionManager service provides a facility to listen 
+            for incoming socket connections.
+            The DefaultConnectionManager compoent gives a thread pooled 
+            implementation of this service. If there are multiple server 
+            components depending on this component, they would all share
+            the same thread pool.
+            </p>
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs lifescycle stages and handles assignment
+                 of logging channels to managed connection handlers.</td></tr>
+                <tr>
+                  <td>Serviceable</td>
+                  <td>
+                  The connection manager has a structural dependency on the 
+                  <a href="threads.html">Threads</a>component.
+                  </td>
+                </tr>
+                <tr>
+                  <td>Disposable</td>
+                  <td>
+                  Disconnects all standing connections.
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+    </section>
+
+  </body>
+
+</document>
+
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/datasource.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/datasource.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Connection</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Datasource">
+      <subsection name="Description">
+            <p>
+            The ConnectionManager service provides a facility to listen 
+            for incoming socket connections.
+            The DefaultConnectionManager compoent gives a thread pooled 
+            implementation of this service. If there are multiple server 
+            components depending on this component, they would all share
+            the same thread pool.
+            </p>
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs lifescycle stages and handles assignment
+                 of logging channels to managed connection handlers.</td></tr>
+                <tr>
+                  <td>Contextualizable</td>
+                  <td>
+                  <table>
+                    <tr>
+                      <th>Key</th><th>Type</th><th>Required</th>
+                    </tr>
+                    <tr>
+                      <td>block.name</td><td>java.lang.String</td><td>false</td>
+                    </tr>
+                  </table>
+                  </td>
+                </tr>
+                <tr>
+                  <td>Configurable</td>
+                  <td>
+                  <p>Example configuration:</p>
+                  <source>
+ &lt;configuration&gt;
+   &lt;data-source name="<i>default</i>"
+     class="<i>org.apache.avalon.excalibur.datasource.JdbcDataSource</i>"&gt;
+     &lt;!-- configuration for JdbcDataSource --&gt;
+     &lt;pool-controller min="<i>5</i>" max="<i>10</i>" 
+       connection-class="<i>my.overrided.ConnectionClass</i>"&gt;
+     &lt;keep-alive&gt;select 1&lt;/keep-alive&gt;
+     &lt;/pool-controller&gt;
+     &lt;driver&gt;<i>com.database.jdbc.JdbcDriver</i>&lt;/driver&gt;
+     &lt;dburl&gt;<i>jdbc:driver://host/mydb</i>&lt;/dburl&gt;
+     &lt;user&gt;<i>username</i>&lt;/user&gt;
+     &lt;password&gt;<i>password</i>&lt;/password&gt;
+   &lt;/data-source&gt;
+ &lt;/configuration&gt;
+                  </source>
+                  </td>
+                </tr>
+                <tr>
+                  <td>Initializable</td>
+                  <td>
+                  Component initialization.
+                  </td>
+                </tr>
+                <tr>
+                  <td>Disposable</td>
+                  <td>
+                  Component disposal.
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+    </section>
+
+  </body>
+
+</document>
+
+
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/index.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/index.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Thread Manager</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components">
+    <subsection name="Index">
+      <table>
+        <tr>
+          <th>Topic</th>
+          <th>Description</th>
+        </tr>
+        <tr><td><a href="connection.html">Connection</a></td>
+          <td>
+            <p>
+            The ConnectionManager service provides a facility to listen 
+            for incoming socket connections.
+            The DefaultConnectionManager compoent gives a thread pooled 
+            implementation of this service. If there are multiple server 
+            components depending on this component, they would all share
+            the same thread pool.
+            </p>
+          </td>
+        </tr>
+        <tr><td><a href="datasource.html">Datasource</a></td>
+          <td>
+            <p>
+            The DataSourceSelector service provides a way to select 
+            DataSourceComponent.
+            The DefaultDataSourceSelector component provides a set of 
+            ready to use DataSourceComponents.
+            </p>
+          </td>
+        </tr>
+        <tr><td><a href="scheduler.html">Scheduler</a></td>
+          <td>
+           <p>
+           The TimeScheduler service provides a services supporting the 
+           scheduling of activities to occur an certain intervals.
+           The DefaultTimeScheduler block implements the service. When
+           used in conjunction with the service is it a TimeTrigger.  
+           There are two such tiggers provided within the implementation
+           CronTimeTrigger and PeriodicTimeTigger.
+           </p>
+          </td>
+        </tr>
+        <tr><td><a href="sockets.html">Sockets</a></td>
+          <td>
+            <p>
+            The SocketManager service provides a way to lookup a factory 
+            for server of client sockets.  This service is provided by the 
+            DefaultSocketManager component.
+            </p>
+          </td>
+        </tr>
+        <tr><td><a href="store.html">Store</a></td>
+          <td>
+            <p>
+              The Store service provides a way to store named Objects or 
+              Streams without knowing how they are stored.
+              The RepositoryManager block implements this service and 
+              provides (in invocation of select(..) ) an appropriate 
+              Respository.  The two configurable implementations use the 
+              local file system for storage.
+              </p>
+          </td>
+        </tr>
+        <tr><td><a href="threads.html">Threads</a></td>
+          <td>
+            <p>
+            The ThreadManager service provides a way get default or named 
+            Thread Pool.
+            The DefaultThreadManager block implements this service based on
+            the Excalibur implementations of ThreadPool.
+            </p>
+          </td>
+        </tr>
+      </table>
+    </subsection>
+    </section>
+  </body>
+
+</document>
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/navigation.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/navigation.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <title>Cornerstone Threads</title>
+  <body>
+    <menu name="Cornerstone">
+      <item name="Datasource" href="datasource.html"/>
+      <item name="Scheduler" href="scheduler.html"/>
+      <item name="Sockets" href="sockets.html"/>
+      <item name="Store" href="store.html"/>
+      <item name="Threads" href="threads.html"/>
+    </menu>
+  </body>
+</project>

Added: avalon/trunk/central/site/src/xdocs/planet/components/scheduler.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/scheduler.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Connection</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Scheduler">
+      <subsection name="Description">
+           <p>
+           The TimeScheduler service provides a services supporting the 
+           scheduling of activities to occur an certain intervals.
+           The DefaultTimeScheduler block implements the service. When
+           used in conjunction with the service is it a TimeTrigger.  
+           There are two such tiggers provided within the implementation
+           CronTimeTrigger and PeriodicTimeTigger.
+           </p>
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs lifescycle stages and runtime warning.</td></tr>
+                <tr>
+                  <td>Serviceable</td>
+                  <td>
+                  The connection manager has a structural dependency on the 
+                  <a href="threads.html">Threads</a>component.
+                  </td>
+                </tr>
+                <tr>
+                  <td>Startable</td>
+                  <td>
+                  Initiates execution using the default thread pool.
+                  </td>
+                </tr>
+                <tr>
+                  <td>Disposable</td>
+                  <td>
+                  Disposal phase cleanup.
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+    </section>
+
+  </body>
+
+</document>
+
+
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/sockets.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/sockets.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Scheduler</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Sockets">
+      <subsection name="Description">
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs runtime warnings and assigns 
+                 logging channels to created factories.</td></tr>
+                <tr><td>Contextualizable</td>
+                  <td>
+                  <table>
+                    <tr>
+                      <th>Key</th><th>Type</th><th>Required</th>
+                    </tr>
+                    <tr>
+                      <td>block.name</td><td>java.lang.String</td><td>true</td>
+                    </tr>
+                    <tr>
+                      <td>app.name</td><td>java.lang.String</td><td>true</td>
+                    </tr>
+                    <tr>
+                      <td>app.home</td><td>java.io.File</td><td>true</td>
+                    </tr>
+                  </table>
+                  </td>
+                </tr>
+                <tr>
+                  <td>Configurable</td>
+                  <td>
+                  An example configuration is 
+                  presented below.
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+      <subsection name="Example Configuration">
+<source><![CDATA[
+<configuration>
+  <server-sockets>
+    <factory name="plain" 
+class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
+  </server-sockets>
+  <client-sockets>
+    <factory name="plain" 
+class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"/>
+  </client-sockets>
+</configuration>
+]]></source>
+      </subsection>
+    </section>
+
+  </body>
+
+</document>
+
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/store.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/store.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Store</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Datasource">
+      <subsection name="Description">
+        <p>
+          The Store service provides a way to store named Objects or 
+          Streams without knowing how they are stored.
+          The RepositoryManager block implements this service and 
+          provides (in invocation of select(..) ) an appropriate 
+          Respository.  The two configurable implementations use the 
+          local file system for storage.
+        </p>
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs store establishment and 
+                runtime related warnings.</td></tr>
+                <tr>
+                  <td>Contextualizable</td>
+                  <td>
+                  <table>
+                    <tr>
+                      <th>Key</th><th>Type</th><th>Required</th>
+                    </tr>
+                    <tr>
+                      <td>block.name</td><td>java.lang.String</td><td>true</td>
+                    </tr>
+                    <tr>
+                      <td>app.name</td><td>java.lang.String</td><td>true</td>
+                    </tr>
+                    <tr>
+                      <td>app.home</td><td>java.io.File</td><td>true</td>
+                    </tr>
+                  </table>
+                  </td>
+                </tr>
+                <tr>
+                  <td>Configurable</td>
+                  <td>
+                  <p>Example configuration included below.</p>
+                  </td>
+                </tr>
+                <tr>
+                  <td>Serviceable</td>
+                  <td>
+                  WARNING: Implementated but no dependencies declared!
+                  </td>
+                </tr>
+                <tr>
+                  <td>Disposable</td>
+                  <td>
+                  Component disposal.
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+      <subsection name="Example Configuration">
+<p>
+The following example coinfiguration is taken from the 
+<a href="http://james.apache.org/">Apache James Project</a>.
+</p>
+
+<source><![CDATA[
+<configuration>
+  <repositories>
+    <repository
+ class="org.apache.james.mailrepository.filepair.File_Persistent_Object_Repository"> 
+      <protocols>
+        <protocol>file</protocol>
+      </protocols>
+      <types>
+        <type>OBJECT</type>
+      </types>
+      <models>
+        <model>SYNCHRONOUS</model>
+        <model>ASYNCHRONOUS</model>
+        <model>CACHE</model>
+      </models>
+    </repository>
+    <repository 
+class="org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository">
+      <protocols>
+        <protocol>file</protocol>
+      </protocols>
+      <types>
+        <type>STREAM</type>
+      </types>
+      <models>
+        <model>SYNCHRONOUS</model>
+        <model>ASYNCHRONOUS</model>
+        <model>CACHE</model>
+      </models>
+    </repository>
+  </repositories>
+</configuration>
+]]></source>
+      </subsection>
+    </section>
+
+  </body>
+
+</document>
+
+
+
+
+

Added: avalon/trunk/central/site/src/xdocs/planet/components/threads.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/planet/components/threads.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+
+<document>
+
+  <properties>
+    <author email="mcconnell@apache.org">Stephen McConnell</author>
+    <title>Cornerstone Scheduler</title>
+  </properties>
+
+  <body>
+    <section name="Cornerstone Components - Threads">
+      <subsection name="Description">
+        <p>The threads component provides support for the establishment
+        a set of named thread pools.  The component implementation can be configured
+        such that multiple thread pools may be defined within which each pool has 
+        a minimum and maximum pool criteria and daemon property.  Consumer components
+        can access threads from named or default pool using the ThreadManager 
+        service interface.</p>
+      </subsection>
+      <subsection name="Deployment Facts">
+        <table>
+          <tr><td>Containment</td><td>Avalon Framework 4.2.0</td>
+          </tr>
+          <tr><td>Lifestyle</td><td>singleton</td></tr>
+          <tr><td>Lifecycle</td>
+            <td>
+              <table>
+                <tr><th>Stage</th><th>Description</th></tr>
+                <tr><td>LogEnabled</td><td>Logs information concerning created pools during 
+                  configuration at the DEBUG level.</td></tr>
+                <tr>
+                  <td>Configurable</td>
+                  <td>
+                  Declaration of the thread pools and associated 
+                  pool establishment criteria.  An example configuration is 
+                  presented below.
+<source><![CDATA[
+<configuration>
+  <thread-group>
+    <name>default</name>
+    <is-daemon>false</is-daemon>
+    <max-threads>100</max-threads>
+    <min-threads>20</min-threads>
+  </thread-group>
+</configuration>
+]]></source>
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </subsection>
+      <subsection name="Examples">
+        <table>
+          <tr><th>Container</th><th>Description</th></tr>
+          <tr>
+            <td><a href="../examples/threads.html">Merlin</a></td>
+            <td>
+              A demonstration component implementation demonstrates the resolution
+              of a ThreadManager and subsequent access to a ThreadPoll against 
+              which a Runnable object is launched.  Termination of the container 
+              before this time will trigger disposal of the component causing the 
+              interuption of the subsidiary thread.
+            </td>
+          </tr>
+        </table>
+      </subsection>      
+    </section>
+
+  </body>
+
+</document>
+
+

Modified: avalon/trunk/central/site/src/xdocs/planet/facilities/navigation.xml
==============================================================================
--- avalon/trunk/central/site/src/xdocs/planet/facilities/navigation.xml	(original)
+++ avalon/trunk/central/site/src/xdocs/planet/facilities/navigation.xml	Mon May 24 19:18:11 2004
@@ -23,9 +23,9 @@
 
   <body>
     <menu>
-      <item name="Avalon Finder" href="finder.html"/>
-      <item name="Avalon HTTP" href="http.html"/>
-      <item name="Avalon JMX" href="jmx.html"/>
+      <item name="Finder" href="finder.html"/>
+      <item name="HTTP" href="http.html"/>
+      <item name="JMX" href="jmx.html"/>
     </menu>
  </body>
 

Added: avalon/trunk/central/system/index.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/system/index.xml	Mon May 24 19:18:11 2004
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<system>
+
+  <!-- 
+  Declaration of the working repository for artifacts 
+  used and created by this build system.
+  -->
+
+  <repository>
+    <cache dir=".cache"/>
+    <proxy/>
+    <hosts>
+      <host>http://www.dpml.net</host>
+    </hosts>
+  </repository>
+
+  <!--
+  Declaration of the binary resources available through
+  the repository used by local projects.
+  -->
+
+  <resources>
+
+    <resource>
+      <info>
+        <group>avalon-framework</group>
+        <name>avalon-framework-api</name>
+        <version>4.2.0</version>
+        <type>jar</type>
+      </info>
+    </resource>
+    <resource>
+      <info>
+        <group>avalon-framework</group>
+        <name>avalon-framework-impl</name>
+        <version>4.2.0</version>
+        <type>jar</type>
+      </info>
+    </resource>
+    <resource>
+      <info>
+        <group>avalon-util</group>
+        <name>avalon-util-i18n</name>
+        <version>1.0.0</version>
+        <type>jar</type>
+      </info>
+    </resource>
+
+  </resources>
+
+  <!--
+  Declaration of the local projects.
+  -->
+
+  <projects>
+
+    <project basedir="../site">
+      <info>
+        <group>avalon</group>
+        <name>site</name>
+      </info>
+    </project>
+
+  </projects>
+
+</system>

Modified: avalon/trunk/central/system/themes/avalon2/html/transform.xsl
==============================================================================
--- avalon/trunk/central/system/themes/avalon2/html/transform.xsl	(original)
+++ avalon/trunk/central/system/themes/avalon2/html/transform.xsl	Mon May 24 19:18:11 2004
@@ -127,12 +127,14 @@
       <xsl:when test="count( menu ) = 0" >
           <xsl:apply-templates select="menu" >
             <xsl:with-param name="dir" select="concat( $dir, '../')" />
-          </xsl:apply-templates>
+          </xsl:apply-templates>
+        <!--
         <div class="menu">
           <xsl:apply-templates select="item" >
             <xsl:with-param name="dir" select="$dir" />
           </xsl:apply-templates>
-        </div>
+        </div>
+        -->
       </xsl:when>
       <xsl:otherwise>
         <div class="menu">

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java	Mon May 24 19:18:11 2004
@@ -77,9 +77,7 @@
             }
             catch( Throwable e )
             {
-                final String error =
-                  "Error occured while loading system defintion.";
-                throw new BuildException( error, e );
+                throw new BuildException( e );
             }
         }
     }

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java	Mon May 24 19:18:11 2004
@@ -95,12 +95,12 @@
 
     private void copySrcToBuildWithFiltering( File target )
     {
-        copySrcToBuild( target, true, "**/*.java,**/*.x*,**/*.properties", "" );
+        copySrcToBuild( target, true, "**/*.java,**/*.x*,**/*.properties", "**/_svn/**" );
     }
 
     private void copySrcToBuildWithoutFiltering( File target )
     {
-        copySrcToBuild( target, false, "**/*.*", "**/*.java,**/*.x*,**/*.properties" );
+        copySrcToBuild( target, false, "**/*.*", "**/*.java,**/*.x*,**/*.properties,**/_svn/**" );
     }
 
     private void copySrcToBuild( 

Added: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/XdocTask.java
==============================================================================
--- (empty file)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/XdocTask.java	Mon May 24 19:18:11 2004
@@ -0,0 +1,191 @@
+/* 
+ * Copyright 2004 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.
+ */
+
+package org.apache.avalon.tools.tasks;
+
+import java.io.File;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.taskdefs.Copy;
+import org.apache.tools.ant.taskdefs.XSLTProcess;
+
+public class XdocTask extends HomeTask
+{
+    public static final String XDOC_TARGET_SRC_KEY = "avalon.target.src.xdoc";
+    public static final String XDOC_TARGET_SRC_VALUE = 
+       PrepareTask.TARGET_SRC + "/xdocs";
+
+    public static final String XDOC_TARGET_DOCS_KEY = "avalon.target.docs";
+    public static final String XDOC_TARGET_DOCS_VALUE = 
+       PrepareTask.TARGET + "/docs";
+
+    public static final String XDOC_THEME_KEY = "xdoc.theme.name";
+    public static final String XDOC_THEME_VALUE = "avalon2";
+
+    public static final String XDOC_OUTPUT_FORMAT_KEY = "xdoc.output.format";
+    public static final String XDOC_OUTPUT_FORMAT_VALUE = "html";
+
+    public void init()
+    {
+        super.init();
+        setProjectProperty( XDOC_TARGET_SRC_KEY, XDOC_TARGET_SRC_VALUE );
+        setProjectProperty( XDOC_TARGET_DOCS_KEY, XDOC_TARGET_DOCS_VALUE );
+        setProjectProperty( XDOC_THEME_KEY, XDOC_THEME_VALUE );
+        setProjectProperty( XDOC_OUTPUT_FORMAT_KEY, XDOC_OUTPUT_FORMAT_VALUE );
+    }
+
+    private File getThemesDirectory()
+    {
+        return new File( getHome().getHomeDirectory(), "themes" );
+    }
+
+    private File getTargetSrcXdocDirectory()
+    {
+        File basedir = getProject().getBaseDir();
+        return new File( basedir, getProject().getProperty( XDOC_TARGET_SRC_KEY ) );
+    }
+
+    private File getTargetDocsDirectory()
+    {
+        File basedir = getProject().getBaseDir();
+        return new File( basedir, getProject().getProperty( XDOC_TARGET_DOCS_KEY ) );
+    }
+    
+    private File getTargetBuildXdocDirectory()
+    {
+        File target = PrepareTask.getTargetDirectory( getProject() );
+        return new File( target, "temp/xdoc-build" );
+    }
+    
+    private String getTheme()
+    {
+        return getProject().getProperty( XDOC_THEME_KEY );
+    }
+
+    private String getOutputFormat()
+    {
+        return getProject().getProperty( XDOC_OUTPUT_FORMAT_KEY );
+    }
+
+    public void execute()
+    {        
+        File srcDir = getTargetSrcXdocDirectory();
+        if( !srcDir.exists() ) return;
+
+        File destDir = getTargetBuildXdocDirectory();
+        createDirectory( destDir );
+
+        String theme = getTheme();
+        String output = getOutputFormat();
+        File themeRoot = getThemesDirectory();
+        File themeDir = new File( themeRoot, theme + "/" + output );
+        
+        log( "   Source: " + srcDir.getAbsolutePath() );
+        log( "     Dest: " + destDir.getAbsolutePath() );
+        log( "Theme Dir: " + themeDir );
+        
+        try
+        {
+            transformNavigation( themeDir, srcDir, destDir );
+            copySources( srcDir, destDir );
+            transformXdocs( themeDir, destDir );
+            copyResources( themeDir );
+        } 
+        catch( Throwable e )
+        {
+            log( "XSLT execution failed: " + e.getMessage() );
+            throw new BuildException( e );
+        }
+    }
+    
+    private void transformNavigation( File themeDir, File source, File dest )
+    {
+        File xslFile = new File( themeDir,  "nav-aggregate.xsl" );
+        transform( source, dest, xslFile, "**/navigation.xml", "", ".xml", "xml" );
+    }
+    
+    private void copySources( File source, File dest )
+    {
+        copy( source, dest, "**/*", "**/navigation.xml" );
+    }
+    
+    private void transformXdocs( File themeDir, File build )
+    {
+        File xslFile = new File( themeDir,  "transform.xsl" );
+        String output = getOutputFormat();
+        File docs = getTargetDocsDirectory();
+        transform( build, docs, xslFile, "**/*.xml", "**/navigation.xml", "." + output, "html" );
+    }
+    
+    private void copyResources( File themeDir )
+    {
+        File destDir = getTargetDocsDirectory();
+        File toDir = new File( destDir, "resources" );
+        File fromDir = new File( themeDir, "resources" );
+        copy( fromDir, toDir, "**/*", "" );
+    }
+    
+    private void copy( File fromDir, File toDir, String includes, String excludes )
+    {
+        FileSet from = new FileSet();
+        from.setDir( fromDir );
+        from.setIncludes( includes );
+        from.setExcludes( excludes + ",**/_svn/**" );
+        toDir.mkdirs();  /* ensure that the directory exists. */
+        
+        Copy copy = (Copy) getProject().createTask( "copy" );
+        copy.setTodir( toDir );
+        copy.addFileset( from );
+        copy.execute();
+    }
+    
+    private void transform( File srcDir, File toDir, File xslFile, 
+                            String includes, String excludes, String extension,
+                            String method )
+    {
+        XSLTProcess xslt = (XSLTProcess) getProject().createTask( "xslt" );
+        xslt.setDestdir( toDir );
+        xslt.setStyle( xslFile.getAbsolutePath() );
+        xslt.setBasedir( srcDir );
+        xslt.setIncludes( includes );
+        xslt.setForce( true );
+        xslt.setExtension( extension );
+        xslt.setExcludes( excludes );
+        
+        XSLTProcess.OutputProperty prop1 = xslt.createOutputProperty();
+        prop1.setName( "method" );
+        prop1.setValue( method );
+        
+        XSLTProcess.OutputProperty prop2 = xslt.createOutputProperty();
+        prop2.setName( "standalone" );
+        prop2.setValue( "yes" );
+        
+        XSLTProcess.OutputProperty prop3 = xslt.createOutputProperty();
+        prop3.setName( "encoding" );
+        prop3.setValue( "iso8859_1" );
+        
+        XSLTProcess.OutputProperty prop4 = xslt.createOutputProperty();
+        prop4.setName( "indent" );
+        prop4.setValue( "yes" );
+          
+        xslt.init();
+        xslt.execute();
+    }
+} 

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org