Author: tchemit Date: 2009-11-07 11:48:58 +0100 (Sat, 07 Nov 2009) New Revision: 45 Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties Log: Anomalie #124: La g?\195?\169n?\195?\169ration du changes.xml n'est pas correcte Anomalie #125: Les heures dans le rapport des demandes sont pas correc Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2009-11-07 10:47:15 UTC (rev 44) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2009-11-07 10:48:58 UTC (rev 45) @@ -20,49 +20,32 @@ */ package org.nuiton.jredmine.plugin; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.changes.model.Action; -import org.apache.maven.plugins.changes.model.Author; -import org.apache.maven.plugins.changes.model.Body; -import org.apache.maven.plugins.changes.model.ChangesDocument; +import org.apache.maven.plugins.changes.model.*; import org.apache.maven.plugins.changes.model.Properties; -import org.apache.maven.plugins.changes.model.Release; import org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Writer; import org.codehaus.plexus.util.xml.XmlStreamWriter; -import org.nuiton.jredmine.model.Issue; -import org.nuiton.jredmine.model.IssueCategory; -import org.nuiton.jredmine.model.IssueStatus; -import org.nuiton.jredmine.model.ModelHelper; -import org.nuiton.jredmine.model.Project; -import org.nuiton.jredmine.model.Tracker; -import org.nuiton.jredmine.model.User; -import org.nuiton.jredmine.model.Version; import org.nuiton.jredmine.RedmineServiceException; +import org.nuiton.jredmine.model.*; import org.nuiton.plugin.PluginHelper; +import java.io.File; +import java.util.*; +import java.util.Map.Entry; + /** * Generates the changes.xml file from the Redmine's server to be used * by the maven-changes-plugin to generates the release report and send * the annoncement mail at a release time. * - * @since 1.0.0 - * * @author tchemit * @goal generate-changes + * @since 1.0.0 */ public class GenerateChangesMojo extends AbstractRedmineMojo implements IssueCollectorConfiguration { /** * The actions understood by the changes.xml format. - * */ enum Actions { @@ -71,6 +54,7 @@ update, remove } + /** * The path of the <code>changes.xml</code> file that will be converted into an HTML report. * @@ -81,7 +65,7 @@ protected File xmlPath; /** * The description of the release. - * + * <p/> * <b>Note :</b> if not sets - will use the redmine version description (if exists). * * @parameter expression="${releaseDescription}" @@ -107,13 +91,13 @@ protected boolean onlyCurrentVersion; /** * The action mapping to the redmine tracker ids. - * + * <p/> * Possible actions are {@code add}, {@code fix}, {@code update}, {@code remove} - * + * <p/> * The syntax of mapping is {@code action:id [,action:id]*} - * + * <p/> * Example : - * + * <p/> * <pre> * fix:1 * fix:1, add:1 @@ -126,18 +110,20 @@ protected String actionMapping; /** * The comma separated list of statuses ids to include in the changes.xml - * + * <p/> * <b>Note :</b> If a value is set to empty - that means to include all status. * <p/> + * * @parameter expression="${redmine.statusIds}" * @since 1.0.0 */ protected String statusIds; /** * The comma separated list of category ids to include in the changes.xml - * + * <p/> * <b>Note :</b> If a value is set to empty - that means to include all categories. * <p/> + * * @parameter expression="${redmine.categoryIds}" * @since 1.0.0 */ @@ -558,20 +544,39 @@ if (issue.getDueDate() != null) { action.setDate(dateFormat.format(issue.getDueDate())); } else { - getLog().warn("issue " + issue.getSubject() + " has no dueDate..."); + if (verbose) { + getLog().warn("issue " + issue.getSubject() + " has no dueDate..."); + } } - int id = issue.getAssignedToId(); + User a; + int id; + + // created by + + id = issue.getAuthorId(); if (id == 0) { - getLog().warn("issue " + issue.getSubject() + " is not assigned to any user, this is not normal..."); + getLog().warn("issue " + issue.getSubject() + " is not created to any user, this is not normal..."); id = issue.getAuthorId(); } - User a = ModelHelper.byId(issue.getAuthorId(), users); + a = ModelHelper.byId(id, users); + if (a != null) { action.setDueTo(a.getFirstname() + " " + a.getLastname()); action.setDueToEmail(a.getMail()); + } + // resolved by + + id = issue.getAssignedToId(); + if (id == 0) { + getLog().warn("issue " + issue.getSubject() + " is not assigned to any user, this is not normal..."); + id = issue.getAuthorId(); + } + a = ModelHelper.byId(id, users); + if (a != null) { + //TODO should check this is a developper name on pom.xml action.setDev(a.getLogin()); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java 2009-11-07 10:47:15 UTC (rev 44) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java 2009-11-07 10:48:58 UTC (rev 45) @@ -87,7 +87,7 @@ /** * Collects the issues given the configuration passed. * - * @param service + * @param service redmine service to obtain datas * @param config the collector configuration * * @throws RedmineServiceException if any pb while retreave datas from redmine @@ -189,7 +189,7 @@ /** * Prepare the collector filters due to the given collector configuration. * - * @param service + * @param service redmine service to obtain datas * @param config the collector configuration * @throws RedmineServiceException if any pb whiile retreaving redmine's datas */ Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java 2009-11-07 10:47:15 UTC (rev 44) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java 2009-11-07 10:48:58 UTC (rev 45) @@ -301,7 +301,7 @@ * @param log the logger * @param columnNames The names of the columns to include in the report * @param groupBy the group by column name (or null if not grouped) - * @throws MavenReportException + * @throws MavenReportException if any pb */ public IssueReportGenerator(Log log, String columnNames, String groupBy) throws MavenReportException { @@ -669,7 +669,7 @@ } protected void sinkDate(Sink sink, Date d) { - String text = null; + String text; if (d == null) { text = " - "; } else { @@ -679,7 +679,7 @@ } protected void sinkI18nAble(Sink sink, int id, I18nAble obj) { - String t = null; + String t; if (obj == null) { t = id == 0 ? " - " : id + ""; } else { Modified: trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties =================================================================== --- trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties 2009-11-07 10:47:15 UTC (rev 44) +++ trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties 2009-11-07 10:48:58 UTC (rev 45) @@ -50,7 +50,7 @@ report.empty=No issues to display in the report. report.error=An error occured that made it impossible to generate this report. \ Please check the console for information on what might be the cause of this. -report.date.format=yyy-MM-dd 'at' mm:hh +report.date.format=yyy-MM-dd 'at' hh:mm report.label.key=Key report.label.summary=Summary report.label.status=Status Modified: trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties =================================================================== --- trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties 2009-11-07 10:47:15 UTC (rev 44) +++ trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties 2009-11-07 10:48:58 UTC (rev 45) @@ -50,7 +50,7 @@ report.empty=Pas de demandes \u00E0 afficher dans le rapport. report.error=An error occured that made it impossible to generate this report. \ Please check the console for information on what might be the cause of this. -report.date.format=dd/MM/yyyy '\u00E0' mm:hh +report.date.format=dd/MM/yyyy '\u00E0' hh:mm report.label.key=Sujet report.label.summary=Description report.label.status=Statut