jvanzyl     2004/04/07 08:09:32

  Modified:    maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc
                        XdocPlugin.java
  Log:
  o turning the xdoc plugin into an integrated plugin.
  
  Revision  Changes    Path
  1.3       +19 -28    
maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/XdocPlugin.java
  
  Index: XdocPlugin.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/XdocPlugin.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XdocPlugin.java   7 Apr 2004 02:10:19 -0000       1.2
  +++ XdocPlugin.java   7 Apr 2004 15:09:32 -0000       1.3
  @@ -2,6 +2,8 @@
   
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.xdoc.render.DefaultXdocRenderer;
  +import org.apache.maven.plugin.PluginExecutionResponse;
  +import org.apache.maven.plugin.PluginExecutionRequest;
   import org.codehaus.plexus.util.FileUtils;
   import org.codehaus.plexus.util.IOUtil;
   
  @@ -20,15 +22,15 @@
    */
   public class XdocPlugin
   {
  -    private String xdocDirectory;
  -
  -    private String outputDirectory;
  +    private DefaultXdocRenderer renderer;
   
  -    private MavenProject project;
  +    public XdocPlugin()
  +        throws Exception
  +    {
  +        renderer = new DefaultXdocRenderer();
  +    }
   
  -    private DefaultXdocRenderer renderer;
  -    
  -    private String[] css = 
  +    private String[] css =
           {
               "style/maven-base.css",
               "style/maven-theme.css"
  @@ -41,25 +43,14 @@
               "images/maven-button-1.png"
           };
   
  -    public void setXdocDirectory( String xdocDirectory )
  -    {
  -        this.xdocDirectory = xdocDirectory;
  -    }
  -
  -    public void setProject( MavenProject project )
  +    public void execute( PluginExecutionRequest request, PluginExecutionResponse 
response )
  +        throws Exception
       {
  -        this.project = project;
  -    }
  +        String xdocDirectory = (String) request.getParameter( "xdocDirectory" );
   
  -    public void setOutputDirectory( String outputDirectory )
  -    {
  -        this.outputDirectory = outputDirectory;
  -    }
  +        String outputDirectory = (String) request.getParameter( "outputDirectory" );
   
  -    public void execute()
  -        throws Exception
  -    {
  -        renderer = new DefaultXdocRenderer();
  +        MavenProject project = (MavenProject) request.getParameter( "project" );
   
           List files = FileUtils.getFileNames( new File( xdocDirectory ), "**/*.xml", 
"style/**,navigation.xml", false );
   
  @@ -70,14 +61,14 @@
   
           // Copy style directory
   
  -        copyStyle();
  +        copyStyle( outputDirectory );
           
  -        copyImages();
  +        copyImages( outputDirectory );
   
           FileUtils.copyDirectory( new File( xdocDirectory, "images" ), new File( 
outputDirectory, "images" ) );
       }
       
  -    private void copyStyle()
  +    private void copyStyle( String outputDirectory )
           throws Exception
       {
           File styles = new File( outputDirectory, "style" );
  @@ -92,7 +83,7 @@
           }
       }
       
  -    private void copyImages()
  +    private void copyImages( String outputDirectory )
           throws Exception
       {
           File images = new File( outputDirectory, "images" );
  
  
  

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

Reply via email to