[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] jboss-aop/src/resources/stylesheets xtags2html.xslt
From:       andy godwin <andygodwin () users ! sourceforge ! net>
Date:       2003-06-30 13:08:48
[Download RAW message or body]

  User: andygodwin
  Date: 03/06/30 06:08:48

  Modified:    src/resources/stylesheets xtags2html.xslt
  Log:
  Added the XDoclet documentation to the stylesheet ... this should really go
  somewhere else!
  
  Revision  Changes    Path
  1.2       +198 -1    jboss-aop/src/resources/stylesheets/xtags2html.xslt
  
  Index: xtags2html.xslt
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-aop/src/resources/stylesheets/xtags2html.xslt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xtags2html.xslt	29 Jun 2003 21:47:06 -0000	1.1
  +++ xtags2html.xslt	30 Jun 2003 13:08:48 -0000	1.2
  @@ -1,12 +1,13 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   
  +<xsl:template match="/">
  +
   <!--
     This is a simple stylesheet, derived from XDoclet's xtags2xdoc.xslt,
     that transforms the standard xtags.xml tag documentation file into an
     html file suitable for the JBoss website.
   -->
   
  -<xsl:template match="/">
   <html>
   <head>
   <!--
  @@ -22,6 +23,202 @@
   
   <xsl:comment> =============================== CUT HERE ============================== </xsl:comment>
   
  +  <!-- introduction docs, this lot should probably go in a separate file
  +       included in the stylesheet somehow, maybe another time :) -->
  +  <h2>JBoss AOP XDoclet Support</h2>
  +  <h3>Contents</h3>
  +  
  +  <dl>
  +    <dt><a href="#introduction">Introduction</a></dt>
  +    <dd></dd>
  +    <dt><a href="#ant">Using with Ant</a></dt>
  +    <dd>
  +      <dl>
  +        <dt><a href="#antmerge">Merge Points</a></dt>
  +        <dd></dd>
  +      </dl>
  +    </dd>
  +    <dt><a href="#xml">XmlLoadable and arbitrary XML data</a></dt>
  +    <dd>
  +      <dl>
  +        <dt><a href="#xmlattribute">The xml attribute</a></dt>
  +        <dd></dd>
  +        <dt><a href="#transforming">Transforming attributes to XML elements</a></dt>
  +        <dd></dd>
  +      </dl>
  +    </dd>
  +    <dt><a href="#tagorder">Tag Ordering</a></dt>
  +    <dd></dd>
  +    <dt><a href="#tagdocs">Tag Documentation</a></dt>
  +    <dd></dd>
  +  </dl>
  +  
  +  <h3><a name="introduction">Introduction</a></h3>
  +
  +  <p align="left">
  +  An XDoclet jar is included with JBoss 4,
  +  <code>tools/xdoclet/xdoclet-modules-jboss-aop.jar</code>, allowing you to
  +  write your JBoss AOP deployment descriptors using tags in your source files,
  +  in the same way as for EJBs, JMX MBeans, etc.  Currently, most of the AOP
  +  elements are supported and more wil be added shortly.
  +  </p>
  +  
  +  <h3><a name="ant">Using with Ant</a></h3>
  +  
  +  <p align="left">
  +  Using JBoss AOP XDoclet in your Ant build.xml file is the same as using any
  +  custom XDoclet task. To access the JBoss AOP XDoclet tools you can either
  +  copy the jar, <code>xdoclet-modules-jboss-aop.jar</code>, into your XDoclet
  +  lib directory, or just add it to the classpath when you define the task.
  +  To define the AOP task, use a &lt;taskdef...&gt; element, include your java
  +  source files using a nested &lt;fileset&gt; element, and call the jbossaop
  +  subtask to generate the jboss-aop.xml deployment descriptor, for example:
  +  <pre>
  +    &lt;taskdef name="aopdoclet"
  +             classname="xdoclet.modules.jboss.aop.JBossAopTask"
  +             classpathref="xdoclet.classpath"/&gt;
  +
  +    &lt;aopdoclet destdir="${build.dir}/META-INF"&gt;
  +      &lt;fileset dir="${src.dir}"&gt;
  +        &lt;include name="**/*.java"/&gt; 
  +      &lt;/fileset&gt;
  +      &lt;jbossaop/&gt;
  +    &lt;/aopdoclet&gt;
  +  </pre>
  +  </p>
  +
  +  <p align="left">
  +  The task class, <code>xdoclet.modules.jboss.aop.JBossAopTask</code>, is
  +  derived from <code>xdoclet.DocletTask</code> and consequently supports
  +  all the attributes and nested elements of DocletTask, for example
  +  destdir, force, mergeDir, etc.
  +  </p>
  +  
  +  <h4><a name="antmerge">Merge Points</a></h4>
  +  
  +  <p align="left">
  +  Merge points are provided at the global level and for each individual
  +  source file processed. For global level AOP XML data, simply supply
  +  a file called jboss-aop.xml in the top of the merge directory, the
  +  contents of this file will be merged into the generated jboss-aop.xml
  +  file.  For individual class level AOP XML data, supply a file called
  +  classname-aop.xml in a directory underneath the merge directory that
  +  mirrors the package directory structure of the source file.
  +  </p>  
  +
  +  <h3><a name="xml">XmlLoadable and arbitrary XML</a></h3>
  +
  +  <p align="left">
  +  An Interceptor class, or an Interceptor factory class, may implement the
  +  <code>org.jboss.util.xml.XmlLoadable</code> interface, which allows arbitrary
  +  configuration data, in XML format, to be passed to the class at construction.
  +  In addition, custom class metadata potentially requires arbitrary XML data
  +  included in the jboss-aop.xml file, to specify metadata at class, method level.
  +  There are two ways to specify this data in the XDoclet tags:
  +  </p>
  +
  +  <ol>
  +    <li>The xml attribute</li>
  +    <li>Transforming attributes to XML elements</li>
  +  </ol>
  +  
  +  <h4><a name="xmlattribute">The xml attribute</a></h4>
  +
  +  <p align="left">
  +  You can simply write the required XML configuration data in the xml attribute.
  +  For example, the following metadata declaration:
  +  </p>
  +  
  +  <pre>
  +    package com.acme;
  +    /**
  +     * @jboss-aop.metadata group="MyGroup" 
  +     *                     xml="&lt;config&gt;some value&lt;/config&gt;"
  +     */
  +    public class MyClass
  +    {
  +    }
  +  </pre>
  +
  +  <p align="left">
  +  results in:
  +  </p>
  +  
  +  <pre>
  +    &lt;class-metadata class="com.acme.MyClass" group="MyGroup"&gt;
  +      &lt;default&gt;
  +        &lt;config&gt;some value&lt;/config&gt;
  +      &lt;/default&gt;
  +    &lt;/class-metadata&gt;
  +  </pre>
  +
  +  <h4><a name="transforming">Transforming attributes to XML elements</a></h4>
  +
  +  <p align="left">
  +  If the xml attribute is not present, any unrecognised attributes of the
  +  tag will be converted into XML elements, using the attribute name
  +  as the element name and the attribute value as the element content.  So the
  +  previous example could be written as:
  +  </p>
  +
  +  <pre>
  +    package com.acme;
  +    /**
  +     * @jboss-aop.metadata group="MyGroup" 
  +     *                     config="some value"
  +     */
  +    public class MyClass
  +    {
  +    }
  +  </pre>
  +  
  +  <h3><a name="tagorder">Tag Ordering</a></h3>
  +  
  +  <p align="left">
  +  Stack and Interceptor Pointcut definitions are just lists of Interceptors and,
  +  optionally, other Stacks.  The ordering of such a list is obviously important.
  +  To support declaring these elements in a source file, multiple XDoclet tags
  +  may be used, the ordering of the tags in the source file is maintained in
  +  the generated XML data.  For example, a Stack may be declared as follows:
  +  </p>
  +  
  +  <pre>
  +    /**
  +     *
  +     * @jboss-aop.stack name="MyFirstStack"
  +     * @jboss-aop.stack class="com.foo.SimpleInterceptor"
  +     * @jboss-aop.stack factory="com.foo.AnotherInterceptorFactory" 
  +     * @jboss-aop.stack class="com.foo.TestingInterceptor"
  +     *                  singleton="true"
  +     *                  config="Some config data"
  +     * 
  +     */
  +  </pre>
  +
  +  <p align="left">
  +  resulting in the following generated XML:
  +  </p>
  +  
  +  <pre>
  +  &lt;stack name="MyFirstStack"&gt;
  +    &lt;interceptor class="com.foo.SimpleInterceptor"&gt;
  +    &lt;/interceptor&gt;
  +    &lt;interceptor factory="com.foo.AnotherInterceptorFactory"&gt;
  +    &lt;/interceptor&gt;
  +    &lt;interceptor class="com.foo.TestingInterceptor"
  +                 singleton="true"&gt;
  +      &lt;config&gt;Some config data&lt;/config&gt;
  +    &lt;/interceptor&gt;
  +  &lt;/stack&gt;
  +  </pre>
  +
  +  <p align="left">
  +  This approach has the drawback that only a single Stack or Interceptor
  +  Pointcut may be declared in a source file, as all tags are combined
  +  to generate a single element.
  +  </p>
  +  
  +  <h3><a name="tagdocs">Tag Documentation</a></h3>
     <xsl:for-each select="xdoclet/namespace">
       <table cellspacing="5" cellpadding="5">
         <tr>
  
  
  


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic