mirror of https://github.com/apache/maven.git
[MNG-411]. Added post column in the mailing list reports.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@179812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c4809aed16
commit
f0cb76ca8e
|
@ -146,12 +146,18 @@ public class MailingListsReport
|
||||||
this.model = model;
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.apache.maven.reporting.MavenReportRenderer#getTitle()
|
||||||
|
*/
|
||||||
// How to i18n these ...
|
// How to i18n these ...
|
||||||
public String getTitle()
|
public String getTitle()
|
||||||
{
|
{
|
||||||
return "Project Mailing Lists";
|
return "Project Mailing Lists";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.apache.maven.reporting.AbstractMavenReportRenderer#renderBody()
|
||||||
|
*/
|
||||||
public void renderBody()
|
public void renderBody()
|
||||||
{
|
{
|
||||||
startSection( getTitle() );
|
startSection( getTitle() );
|
||||||
|
@ -181,42 +187,86 @@ public class MailingListsReport
|
||||||
|
|
||||||
if ( otherArchives )
|
if ( otherArchives )
|
||||||
{
|
{
|
||||||
tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Archive", "Other Archives"} );
|
tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Post", "Archive", "Other Archives"} );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Archive"} );
|
tableHeader( new String[]{"Name", "Subscribe", "Unsubscribe", "Post", "Archive"} );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( Iterator i = model.getMailingLists().iterator(); i.hasNext(); )
|
for ( Iterator i = model.getMailingLists().iterator(); i.hasNext(); )
|
||||||
{
|
{
|
||||||
MailingList m = (MailingList) i.next();
|
MailingList m = (MailingList) i.next();
|
||||||
|
|
||||||
// Verify that subsribe and unsubsribe lists are valid?
|
|
||||||
// Same for archive?
|
|
||||||
if ( ( ( m.getOtherArchives() != null ) ) && ( m.getOtherArchives().size() > 0 ) )
|
|
||||||
{
|
|
||||||
List textRow = new ArrayList();
|
List textRow = new ArrayList();
|
||||||
List hrefRow = new ArrayList();
|
List hrefRow = new ArrayList();
|
||||||
|
|
||||||
|
// Validate here subsribe/unsubsribe lists and archives?
|
||||||
|
if ( m.getName() != null )
|
||||||
|
{
|
||||||
textRow.add( m.getName() );
|
textRow.add( m.getName() );
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// By default, a name should be set
|
||||||
|
textRow.add( "???NOT_SET???" );
|
||||||
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m.getSubscribe() != null )
|
||||||
|
{
|
||||||
textRow.add( "Subscribe" );
|
textRow.add( "Subscribe" );
|
||||||
hrefRow.add( m.getSubscribe() );
|
hrefRow.add( m.getSubscribe() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textRow.add( null );
|
||||||
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m.getUnsubscribe() != null )
|
||||||
|
{
|
||||||
textRow.add( "Unsubscribe" );
|
textRow.add( "Unsubscribe" );
|
||||||
hrefRow.add( m.getUnsubscribe() );
|
hrefRow.add( m.getUnsubscribe() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textRow.add( null );
|
||||||
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m.getPost() != null )
|
||||||
|
{
|
||||||
|
textRow.add( "Post" );
|
||||||
|
hrefRow.add( m.getPost() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textRow.add( null );
|
||||||
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m.getArchive() != null )
|
||||||
|
{
|
||||||
textRow.add( getArchiveServer( m.getArchive() ) );
|
textRow.add( getArchiveServer( m.getArchive() ) );
|
||||||
hrefRow.add( m.getArchive() );
|
hrefRow.add( m.getArchive() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textRow.add( null );
|
||||||
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ( ( m.getOtherArchives() != null ) ) && ( m.getOtherArchives().size() > 0 ) )
|
||||||
|
{
|
||||||
// For the first line
|
// For the first line
|
||||||
Iterator it = m.getOtherArchives().iterator();
|
Iterator it = m.getOtherArchives().iterator();
|
||||||
String otherArchive = (String) it.next();
|
String otherArchive = it.next().toString();
|
||||||
|
|
||||||
textRow.add( getArchiveServer( otherArchive ) );
|
textRow.add( getArchiveServer( otherArchive ) );
|
||||||
hrefRow.add( otherArchive );
|
hrefRow.add( otherArchive );
|
||||||
|
|
||||||
tableRowWithLink( (String[]) textRow.toArray( new String[0] ),
|
tableRowWithLink( (String[]) textRow.toArray( new String[0] ),
|
||||||
(String[]) hrefRow.toArray( new String[0] ) );
|
(String[]) hrefRow.toArray( new String[0] ) );
|
||||||
|
|
||||||
|
@ -229,16 +279,24 @@ public class MailingListsReport
|
||||||
textRow = new ArrayList();
|
textRow = new ArrayList();
|
||||||
hrefRow = new ArrayList();
|
hrefRow = new ArrayList();
|
||||||
|
|
||||||
textRow.add( "" );
|
// Name
|
||||||
|
textRow.add( null );
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
|
||||||
textRow.add( "" );
|
// Subscribe
|
||||||
|
textRow.add( null );
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
|
||||||
textRow.add( "" );
|
// UnSubscribe
|
||||||
|
textRow.add( null );
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
|
||||||
textRow.add( "" );
|
// Post
|
||||||
|
textRow.add( null );
|
||||||
|
hrefRow.add( null );
|
||||||
|
|
||||||
|
// Archive
|
||||||
|
textRow.add( null );
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
|
||||||
textRow.add( getArchiveServer( otherArchive ) );
|
textRow.add( getArchiveServer( otherArchive ) );
|
||||||
|
@ -252,48 +310,13 @@ public class MailingListsReport
|
||||||
{
|
{
|
||||||
if ( otherArchives )
|
if ( otherArchives )
|
||||||
{
|
{
|
||||||
List textRow = new ArrayList();
|
textRow.add( null );
|
||||||
List hrefRow = new ArrayList();
|
|
||||||
|
|
||||||
textRow.add( m.getName() );
|
|
||||||
hrefRow.add( null );
|
|
||||||
|
|
||||||
textRow.add( "Subscribe" );
|
|
||||||
hrefRow.add( m.getSubscribe() );
|
|
||||||
|
|
||||||
textRow.add( "Unsubscribe" );
|
|
||||||
hrefRow.add( m.getUnsubscribe() );
|
|
||||||
|
|
||||||
textRow.add( getArchiveServer( m.getArchive() ) );
|
|
||||||
hrefRow.add( m.getArchive() );
|
|
||||||
|
|
||||||
textRow.add( "" );
|
|
||||||
hrefRow.add( null );
|
hrefRow.add( null );
|
||||||
|
}
|
||||||
|
|
||||||
tableRowWithLink( (String[]) textRow.toArray( new String[0] ),
|
tableRowWithLink( (String[]) textRow.toArray( new String[0] ),
|
||||||
(String[]) hrefRow.toArray( new String[0] ) );
|
(String[]) hrefRow.toArray( new String[0] ) );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
List textRow = new ArrayList();
|
|
||||||
List hrefRow = new ArrayList();
|
|
||||||
|
|
||||||
textRow.add( m.getName() );
|
|
||||||
hrefRow.add( null );
|
|
||||||
|
|
||||||
textRow.add( "Subscribe" );
|
|
||||||
hrefRow.add( m.getSubscribe() );
|
|
||||||
|
|
||||||
textRow.add( "Unsubscribe" );
|
|
||||||
hrefRow.add( m.getUnsubscribe() );
|
|
||||||
|
|
||||||
textRow.add( getArchiveServer( m.getArchive() ) );
|
|
||||||
hrefRow.add( m.getArchive() );
|
|
||||||
|
|
||||||
tableRowWithLink( (String[]) textRow.toArray( new String[0] ),
|
|
||||||
(String[]) hrefRow.toArray( new String[0] ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
endTable();
|
endTable();
|
||||||
|
@ -311,7 +334,7 @@ public class MailingListsReport
|
||||||
* @param uri
|
* @param uri
|
||||||
* @return the server name of a web-based mailing list archive server
|
* @return the server name of a web-based mailing list archive server
|
||||||
*/
|
*/
|
||||||
private static String getArchiveServer( String uri )
|
private static String getArchiveServer( final String uri )
|
||||||
{
|
{
|
||||||
if ( uri == null )
|
if ( uri == null )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue