You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benoit Xhenseval <be...@yahoo.com> on 2006/11/02 02:08:29 UTC

[m2] Recommended way to generate a report with maven L&F

hI *

What would be the recommended way to generate a report that fits in the Maven 2 site?
We used to generate some xdocs from an XML file under maven 1 (QALab)... but looking at PMD or checkstyle for instance, it seems completely different and not based on xml/xsl anymore.

What is the recommended way?  Is there any good example?

Where would it be documented?

Many thanks

Benoit


Re: [m2] Recommended way to generate a report with maven L&F

Posted by Benoitx <be...@yahoo.com>.
Hi

First of all, thanks for your answers. It is appreciated.

I've found a quick and xml-based way which matches my environment much
better.  I noticed that the plugin-plugin generated some XDOC and that they
were converted very nicely like in maven1.

Which brings me to this question, is xdoc officialy supported?  Will that
change in the foreseable future?  Everything seemed to have move to APT,
yet-another-wiki-style stuff or the programmatic Sink stuff...

Thanks

Benoit


Arnaud Bailly-3 wrote:
> 
> Gisbert Amm <gi...@webde.de> writes:
> 
>> I've written some documentation about that recently:
>>
>> http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin
>>
> 
> Always have a warm feeling being quoted :-)
> I updated the confluence page with the expanded sink API usage example
> I gave in the mail.
> 
> Regards
> -- 
> OQube < software engineering \ génie logiciel >
> Arnaud Bailly, Dr.
> \web> http://www.oqube.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--Recommended-way-to-generate-a-report-with-maven-L-F-tf2557088s177.html#a7154489
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Recommended way to generate a report with maven L&F

Posted by Arnaud Bailly <ab...@oqube.com>.
Gisbert Amm <gi...@webde.de> writes:

> I've written some documentation about that recently:
>
> http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin
>

Always have a warm feeling being quoted :-)
I updated the confluence page with the expanded sink API usage example
I gave in the mail.

Regards
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Recommended way to generate a report with maven L&F

Posted by Gisbert Amm <gi...@webde.de>.
I've written some documentation about that recently:

http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin

Feel free to add your experiences.

-Gisbert

Arnaud Bailly wrote:
> Benoit Xhenseval <be...@yahoo.com> writes:
> 
> 
>>hI *
>>
>>What would be the recommended way to generate a report that fits in
>>the Maven 2 site?
> 
> 
> Do you mean project's documentation or automatic plugin report ?
> 
> In the former case, you can use format APT that is documented on maven
> sites. This is a wiki like format easier to handle than xdoc.
> 
> 
> 
>>What is the recommended way?  Is there any good example?
> 
> 
> You can look at the source code of any report plugin. To speed up
> things a bit, here is a sample I have made for custom plugin (without
> java verbosity):
> 
> 
> /**
>  * A maven 2.0 plugin for generating images of the automata in a FIDL
>  * descriptor. This plugin is used in the <code>site</code> phase to generate
>  * HTML pages describing the specifications of each automaton in a given set of
>  * files.
>  * 
>  * 
>  * @author nono
>  * @goal fidl-graph
>  * @phase site
>  */
> public class GraphGeneratorMojo extends AbstractMavenReport {
> 
> 
>   /**
>    * <i>Maven Internal</i>: The Doxia Site Renderer.
>    * 
>    * @component
>    */
>   private Renderer siteRenderer;
> 
>   /**
>    * <i>Maven Internal</i>: The Project descriptor.
>    * @parameter expression="${project}"
>    * @required
>    * @readonly
>    */
>   private MavenProject project;
> 
> 
>   /*
>    * (non-Javadoc)
>    * 
>    * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
>    */
>   protected String getOutputDirectory() {
>     return outputDirectory.getAbsolutePath();
>   }
> 
>   /**
>    * @return Returns the siteRenderer.
>    */
>   public Renderer getSiteRenderer() {
>     return siteRenderer;
>   }
> 
>   protected MavenProject getProject() {
>     return project;
>   }
> 
>   protected void executeReport(Locale arg0) throws MavenReportException {
>     Sink sink = getSink();
>     /* write */
>     sink.head();
>     sink.title();
>     sink.text("FIDL graph report");
>     sink.title_();
>     sink.head_();
> 
>     sink.body();
>     sink.section1();
> 
>     sink.sectionTitle1();
>     sink.text("FIDL automata index");
>     sink.sectionTitle1_();
>     sink.lineBreak();
>     sink.lineBreak();
> 
>     sink
>         .text("List of behavioral elements with link to graphical representation of FIDL automata.");
> 
>     sink.lineBreak();
>     makeLinks(sink);
>     sink.section1_();
>     sink.body_();
>     sink.flush();
>     sink.close();
> 
>   }
> 
>   public String getOutputName() {
>     return "fidl/index";
>   }
> 
>   public String getName(Locale arg0) {
>     return "FIDL Graph report";
>   }
> 
>   public String getDescription(Locale arg0) {
>     return "Generate graph and HTML summary for FIDL specification";
>   }
> 
> 
>   /**
>    * @param outputDirectory
>    *          The outputDirectory to set.
>    */
>   public void setOutputDirectory(File outputDirectory) {
>     this.outputDirectory = outputDirectory;
>   }
> 
>   /**
>    * @param siteRenderer
>    *          The siteRenderer to set.
>    */
>   public void setSiteRenderer(Renderer siteRenderer) {
>     this.siteRenderer = siteRenderer;
>   }
> 
>   /**
>    * For testing purpose only.
>    * @param project The project to set.
>    */
>   public void setProject(MavenProject project) {
>     this.project = project;
>   }
> 
> }
> 
> Actually, you use an abstract output format (sink).
> 
> 
>>Where would it be documented?
> 
> 
> Unfortunately, nowhere I am aware of. 
> 
> HTH

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Recommended way to generate a report with maven L&F

Posted by Arnaud Bailly <ab...@oqube.com>.
Benoit Xhenseval <be...@yahoo.com> writes:

> hI *
>
> What would be the recommended way to generate a report that fits in
> the Maven 2 site?

Do you mean project's documentation or automatic plugin report ?

In the former case, you can use format APT that is documented on maven
sites. This is a wiki like format easier to handle than xdoc.


> What is the recommended way?  Is there any good example?

You can look at the source code of any report plugin. To speed up
things a bit, here is a sample I have made for custom plugin (without
java verbosity):


/**
 * A maven 2.0 plugin for generating images of the automata in a FIDL
 * descriptor. This plugin is used in the <code>site</code> phase to generate
 * HTML pages describing the specifications of each automaton in a given set of
 * files.
 * 
 * 
 * @author nono
 * @goal fidl-graph
 * @phase site
 */
public class GraphGeneratorMojo extends AbstractMavenReport {


  /**
   * <i>Maven Internal</i>: The Doxia Site Renderer.
   * 
   * @component
   */
  private Renderer siteRenderer;

  /**
   * <i>Maven Internal</i>: The Project descriptor.
   * @parameter expression="${project}"
   * @required
   * @readonly
   */
  private MavenProject project;


  /*
   * (non-Javadoc)
   * 
   * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
   */
  protected String getOutputDirectory() {
    return outputDirectory.getAbsolutePath();
  }

  /**
   * @return Returns the siteRenderer.
   */
  public Renderer getSiteRenderer() {
    return siteRenderer;
  }

  protected MavenProject getProject() {
    return project;
  }

  protected void executeReport(Locale arg0) throws MavenReportException {
    Sink sink = getSink();
    /* write */
    sink.head();
    sink.title();
    sink.text("FIDL graph report");
    sink.title_();
    sink.head_();

    sink.body();
    sink.section1();

    sink.sectionTitle1();
    sink.text("FIDL automata index");
    sink.sectionTitle1_();
    sink.lineBreak();
    sink.lineBreak();

    sink
        .text("List of behavioral elements with link to graphical representation of FIDL automata.");

    sink.lineBreak();
    makeLinks(sink);
    sink.section1_();
    sink.body_();
    sink.flush();
    sink.close();

  }

  public String getOutputName() {
    return "fidl/index";
  }

  public String getName(Locale arg0) {
    return "FIDL Graph report";
  }

  public String getDescription(Locale arg0) {
    return "Generate graph and HTML summary for FIDL specification";
  }


  /**
   * @param outputDirectory
   *          The outputDirectory to set.
   */
  public void setOutputDirectory(File outputDirectory) {
    this.outputDirectory = outputDirectory;
  }

  /**
   * @param siteRenderer
   *          The siteRenderer to set.
   */
  public void setSiteRenderer(Renderer siteRenderer) {
    this.siteRenderer = siteRenderer;
  }

  /**
   * For testing purpose only.
   * @param project The project to set.
   */
  public void setProject(MavenProject project) {
    this.project = project;
  }

}

Actually, you use an abstract output format (sink).

>
> Where would it be documented?

Unfortunately, nowhere I am aware of. 

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org