View Javadoc

1   /*
2    * Copyright 2008-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.maven.issues.bugzilla;
17  
18  import java.util.Locale;
19  
20  /**
21   * The report to generate release plans.
22   *
23   * @goal bugzilla-releaseplan-report
24   * @phase site
25   * @requiresProject
26   * @description Generates a release plan report using issues from the issues
27   *              management system.
28   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
29   * @version $Revision:591 $
30   */
31  public class BugzillaReleasePlanReportMojo extends AbstractBugzillaReportMojo
32  {
33    // ********************************* Fields *********************************
34  
35    // --- constants ------------------------------------------------------------
36  
37    // --- members --------------------------------------------------------------
38  
39    /**
40     * Specifies the name of the file to write the issues report (without
41     * extension).
42     *
43     * @parameter expression="${issues.release.report.fileName}"
44     *            default-value="release-plan-report"
45     * @required
46     * @since 1.0
47     */
48    private String outputName;
49  
50    /**
51     * The name of the class that runs the rendering of the report page.
52     *
53     * @required
54     * @parameter default-value=
55     *            "de.smartics.maven.issues.bugzilla.VersionedSectionReleasePlanReportRenderer"
56     * @since 1.0
57     */
58    private String reportRenderer;
59  
60    /**
61     * Sets the status(es) that you want to limit your report to include. Valid
62     * statuses are: UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, and
63     * CLOSED. Multiple values can be separated by commas.
64     *
65     * @parameter default-value="NEW,ASSIGNED,REOPENED"
66     * @since 1.0
67     */
68    private String status;
69  
70    /**
71     * Lists the columns to be rendered. Each element of this list is a property
72     * of an issue. The identifiers given here must match the ones defined in the
73     * referenced issue management system. E.g. for Bugzilla these are defined in
74     * <code>org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute</code>.
75     * <p>
76     * The values are separated by comma.
77     * </p>
78     *
79     * @parameter default-value=
80     *            "bug_id,short_desc,bug_status,bug_severity"
81     * @required
82     * @since 1.0
83     */
84    private String columns;
85  
86    /**
87     * Lists the column width to be used to set to the columns. If the value is
88     * <code>0</code> (zero) no width will be set explicitly for that column.
89     *
90     * @parameter default-value= "65,0,100,100"
91     * @required
92     * @since 1.0
93     */
94    private String columnWidths;
95  
96    // ****************************** Initializer *******************************
97  
98    // ****************************** Constructors ******************************
99  
100   // ****************************** Inner Classes *****************************
101 
102   // ********************************* Methods ********************************
103 
104   // --- init -----------------------------------------------------------------
105 
106   // --- get&set --------------------------------------------------------------
107 
108   /**
109    * {@inheritDoc}
110    *
111    * @see org.apache.maven.reporting.MavenReport#getOutputName()
112    */
113   public String getOutputName()
114   {
115     return outputName;
116   }
117 
118   /**
119    * Returns the value for status.
120    * <p>
121    * Sets the status(es) that you want to limit your report to include. Valid
122    * statuses are: UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, and
123    * CLOSED. Multiple values can be separated by commas.
124    *
125    * @return the value for status.
126    */
127   public String getStatus()
128   {
129     return status;
130   }
131 
132   // ... plugin metadata ......................................................
133 
134   /**
135    * {@inheritDoc}
136    *
137    * @see org.apache.maven.reporting.AbstractMavenReport#getName(java.util.Locale)
138    */
139   public String getName(final Locale locale)
140   {
141     return getTitle() != null ? getTitle() : getBundle(locale).getString(
142         "report.name.releasePlan");
143   }
144 
145   /**
146    * {@inheritDoc}
147    *
148    * @see org.apache.maven.reporting.AbstractMavenReport#getDescription(java.util.Locale)
149    */
150   public String getDescription(final Locale locale)
151   {
152     return getDescription() != null ? getDescription() : getBundle(locale)
153         .getString("report.description.releasePlan");
154   }
155 
156   // ... report related .......................................................
157 
158   /**
159    * Returns the name of the class that runs the rendering of the report page.
160    *
161    * @return the name of the class that runs the rendering of the report page.
162    */
163   protected String getReportRenderer()
164   {
165     return reportRenderer;
166   }
167 
168   /**
169    * Returns the value for columns.
170    * <p>
171    * Lists the columns to be rendered. Each element of this list is a property
172    * of an issue. The identifiers given here must match the ones defined in the
173    * referenced issue management system. E.g. for Bugzilla these are defined in
174    * {@link org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute}.
175    * <p>
176    * The values are separated by comma.
177    * </p>
178    *
179    * @return the value for columns.
180    */
181   protected String getColumns()
182   {
183     return columns;
184   }
185 
186   /**
187    * Returns the value for columnWidths.
188    * <p>
189    * Lists the column width to be used to set to the columns. If the value is
190    * <code>0</code> (zero) no width will be set explicitly for that column.
191    * </p>
192    *
193    * @return the value for columnWidths.
194    */
195   protected String getColumnWidths()
196   {
197     return columnWidths;
198   }
199 
200   // --- business -------------------------------------------------------------
201 
202   // --- object basics --------------------------------------------------------
203 
204 }