1 Reply Latest reply: Dec 7, 2010 9:36 AM by Jesper Pedersen RSS

[TTALE-106] Add a brief description of report

卢声远 Shengyuan Lu Newbie
Add a method 'outputDescription' which returns a default description String in org.jboss.tattletale.reporting.Report. Then each concrete Report class overrides the 'outputDescription' to define its own description.
a): In each report:
Append outputDescription in each concrete Report  writeHtmlBodyHeader(). Example:
void writeHtmlBodyHeader(BufferedWriter bw) throws IOException{
      bw.write("<h1>" + NAME + "</h1>" + Dump.NEW_LINE);
      //Append Description
      bw.write("<h2>" + outputDescription() + "</h2>" + Dump.NEW_LINE)
   }
b): In general report:
Modify Dump.generateIndex(). Example:
bw.write("<a href=\"" + r.getDirectory() + "/index.html\">" + r.getName() +" ("+r.outputDescription()+ ")</a> (");

Hi, TTale guys, I am new to here!

 

I have an idea about issue: TTALE-106 here.

Add a method 'outputDescription' which returns a default description String in org.jboss.tattletale.reporting.Report. Then each concrete Report class overrides the 'outputDescription' to define its own description.

 

  • In each report:

 

Modify each concrete Report writeHtmlBodyHeader() in each concrete Report. Of course, we could leave the report alone if we don't want to add description to the report.

 

Example:

void writeHtmlBodyHeader(BufferedWriter bw) throws IOException{

      //...

      bw.write("<h1>" + NAME + "</h1>" + Dump.NEW_LINE);

      //Append Description

      bw.write("<h2>" + outputDescription() + "</h2>" + Dump.NEW_LINE)

//...

}

 

  • In general report:

Modify Dump.generateIndex().

Example:

bw.write("<a href=\"" + r.getDirectory() + "/index.html\">" + r.getName() +" ("+r.outputDescription()+ ")</a> (");

 

How do you think about it?

 

Sample patch for 'Dependant report' and screenshots are attached.

  • 1. Re: [TTALE-106] Add a brief description of report
    Jesper Pedersen Master

    The property should probably be called "description" instead. And its output go to a <p></p> tag instead,

     

    I don't know about including the description in the general report (index.html).

     

    The text for the descriptions should be read from a ResourceBundle such that the descriptions can be l10n/i18n - at the same time the rest of the text strings in the reports can be moved too.

     

    Thanks for looking into this