kaz         2003/03/03 13:18:08

  Modified:    src/plugins-build/vdoclet plugin.jelly project.xml
               src/plugins-build/vdoclet/src/main/org/apache/maven/vdoclet
                        VDocletBean.java
               src/plugins-build/xdoc project.xml
  Log:
  Enhanced the vdoclet plugin.  Previous versions did not provide access
  to the Jelly context within the vdoclet velocity templates.  Thus, as a
  result, support of the maven.tasklist.taskTag was dropped and the
  tasklist plugin was hardcoded to use "@todo" because there was no way to
  get the value from the Jelly context.
  
  - VDocletBean can now be passed a JellyContext which gets wrapped in the
    same JellyContextAdapter that I wrote from the Velocity taglib.  To
    access the context from a vdoclet template, use '$jellyContext'.
  
  - Updated the taglib and tag defined in plugin.jelly to automatically
    include the current context.
  
  - Updated the POM to include the jelly deps.  On a side note, also had
    to update the POM of the xdoc plugin as it had a dependency on the
    velocity taglib as well, and it was being loaded before the jar
    specified in this POM.
  
  Revision  Changes    Path
  1.3       +1 -0      jakarta-turbine-maven/src/plugins-build/vdoclet/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/vdoclet/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly      25 Feb 2003 11:50:54 -0000      1.2
  +++ plugin.jelly      3 Mar 2003 21:18:07 -0000       1.3
  @@ -17,6 +17,7 @@
             template="${template}"
             outputFile="${outputFile}"
             encoding="${encoding}"
  +          jellyContext="${context}"
           />
         </define:tag>
       </define:taglib>
  
  
  
  1.5       +11 -0     jakarta-turbine-maven/src/plugins-build/vdoclet/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/vdoclet/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml       3 Mar 2003 14:52:50 -0000       1.4
  +++ project.xml       3 Mar 2003 21:18:07 -0000       1.5
  @@ -51,6 +51,17 @@
         <version>2.0.6</version>
       </dependency>
       <dependency>
  +      <id>commons-jelly</id>
  +      <version>1.0-beta-4</version>
  +      <url>http://jakarta.apache.org/commons/jelly/</url>
  +    </dependency>
  +    <dependency>
  +      <groupId>commons-jelly</groupId>
  +      <artifactId>commons-jelly-tags-velocity</artifactId>
  +      <version>20030303.205659</version>
  +      <url>http://jakarta.apache.org/commons/jelly/</url>
  +    </dependency>
  +    <dependency>
         <id>logkit</id>
         <version>1.0.1</version>
       </dependency>
  
  
  
  1.3       +35 -1     
jakarta-turbine-maven/src/plugins-build/vdoclet/src/main/org/apache/maven/vdoclet/VDocletBean.java
  
  Index: VDocletBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/plugins-build/vdoclet/src/main/org/apache/maven/vdoclet/VDocletBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VDocletBean.java  25 Feb 2003 11:50:54 -0000      1.2
  +++ VDocletBean.java  3 Mar 2003 21:18:08 -0000       1.3
  @@ -1,9 +1,15 @@
   package org.apache.maven.vdoclet;
   
  -import com.thoughtworks.qdox.model.JavaSource;
   import java.io.File;
   import java.io.FileWriter;
   import java.io.IOException;
  +
  +import org.apache.commons.jelly.JellyContext;
  +import org.apache.commons.jelly.tags.velocity.JellyContextAdapter;
  +import org.apache.velocity.context.Context;
  +
  +import com.thoughtworks.qdox.model.JavaSource;
  +
   import vdoclet.Generator;
   import vdoclet.docinfo.DocInfo;
   import vdoclet.docinfo.QDoxBuilder;
  @@ -34,6 +40,9 @@
       /** docinfo */
       DocInfo docInfo;
   
  +    /** The jelly context */
  +    JellyContext jellyContext;
  +
       /**
        * Alias for srcPath
        */
  @@ -50,6 +59,16 @@
           this.destDir = destDir;
       }
   
  +    /** 
  +     * Set the Jelly context.
  +     * 
  +     * @param jellyContext the Jelly context
  +     */
  +    public void setJellyContext(JellyContext jellyContext)
  +    {
  +        this.jellyContext = jellyContext;
  +    }
  +
       /**
        * destDir attribute
        */
  @@ -125,11 +144,26 @@
           
           Generator generator = new Generator(destDir);
           generator.setAttribute("docInfo", docInfo);
  +
  +        if (jellyContext != null)
  +        {
  +            generator.setAttribute("jellyContext", getJellyContextAdapter());
  +        }
  +
           if (encoding != null)
           {
               generator.setAttribute("encoding", encoding);
           }
           generator.eval(template, new FileWriter(new File(destDir, outputFile)));
  +    }
  +
  +    private Context getJellyContextAdapter()
  +    {
  +        JellyContextAdapter adapter = new JellyContextAdapter(jellyContext);
  +
  +        adapter.setReadOnly(true);
  +
  +        return adapter;
       }
   }
   
  
  
  
  1.8       +1 -1      jakarta-turbine-maven/src/plugins-build/xdoc/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/xdoc/project.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.xml       3 Mar 2003 14:52:50 -0000       1.7
  +++ project.xml       3 Mar 2003 21:18:08 -0000       1.8
  @@ -88,7 +88,7 @@
       <dependency>
         <groupId>commons-jelly</groupId>
         <artifactId>commons-jelly-tags-velocity</artifactId>
  -      <version>20030211.144921</version>
  +      <version>20030303.205659</version>
       </dependency>
       <dependency>
         <groupId>commons-jelly</groupId>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to