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 a tabular representation of issues.
22   *
23   * @goal bugzilla-issues-report
24   * @phase site
25   * @requiresProject
26   * @description Generates a release plan report using issues from the issues
27   *              management system rendering them in a simple table.
28   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
29   * @version $Revision:591 $
30   */
31  public class TabularReportMojo 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     * @required
44     * @parameter expression="${issues.release.report.fileName}"
45     *            default-value="issues-tabular-report"
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.TabularReportRenderer"
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="CLOSED"
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,resolution,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,100"
91     * @required
92     * @since 1.0
93     */
94    private String columnWidths;
95  
96    /**
97     * The flag to determine if only the current release version is to be rendered
98     * (<code>true</code>) or all versions are to be considered (
99     * <code>false</code>).
100    *
101    * @parameter default-value="false"
102    * @required
103    * @since 1.0
104    */
105   private boolean currentReleaseVersionOnly;
106 
107   // ****************************** Initializer *******************************
108 
109   // ****************************** Constructors ******************************
110 
111   // ****************************** Inner Classes *****************************
112 
113   // ********************************* Methods ********************************
114 
115   // --- init -----------------------------------------------------------------
116 
117   // --- get&set --------------------------------------------------------------
118 
119   /**
120    * {@inheritDoc}
121    *
122    * @see org.apache.maven.reporting.MavenReport#getOutputName()
123    */
124   public String getOutputName()
125   {
126     return outputName;
127   }
128 
129   /**
130    * Returns the value for status.
131    * <p>
132    * Sets the status(es) that you want to limit your report to include. Valid
133    * statuses are: UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, and
134    * CLOSED. Multiple values can be separated by commas.
135    *
136    * @return the value for status.
137    */
138   public String getStatus()
139   {
140     return status;
141   }
142 
143   // ... plugin metadata ......................................................
144 
145   /**
146    * {@inheritDoc}
147    *
148    * @see org.apache.maven.reporting.AbstractMavenReport#getName(java.util.Locale)
149    */
150   public String getName(final Locale locale)
151   {
152     return getTitle() != null ? getTitle() : getBundle(locale).getString(
153         "report.name.release");
154   }
155 
156   /**
157    * {@inheritDoc}
158    *
159    * @see org.apache.maven.reporting.AbstractMavenReport#getDescription(java.util.Locale)
160    */
161   public String getDescription(final Locale locale)
162   {
163     return description != null ? description : getBundle(locale).getString(
164         "report.description.release");
165   }
166 
167   // ... report related .......................................................
168 
169   /**
170    * Returns the name of the class that runs the rendering of the report page.
171    *
172    * @return the name of the class that runs the rendering of the report page.
173    */
174   protected String getReportRenderer()
175   {
176     return reportRenderer;
177   }
178 
179   /**
180    * Returns the value for columns.
181    * <p>
182    * Lists the columns to be rendered. Each element of this list is a property
183    * of an issue. The identifiers given here must match the ones defined in the
184    * referenced issue management system. E.g. for Bugzilla these are defined in
185    * {@link org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute}.
186    * <p>
187    * The values are separated by comma.
188    * </p>
189    *
190    * @return the value for columns.
191    */
192   protected String getColumns()
193   {
194     return columns;
195   }
196 
197   /**
198    * Returns the value for columnWidths.
199    * <p>
200    * Lists the column width to be used to set to the columns. If the value is
201    * <code>0</code> (zero) no width will be set explicitly for that column.
202    * </p>
203    *
204    * @return the value for columnWidths.
205    */
206   protected String getColumnWidths()
207   {
208     return columnWidths;
209   }
210 
211   /**
212    * Returns the flag to determine if only the current release version is to be
213    * rendered (<code>true</code>) or all versions are to be considered (
214    * <code>false</code>).
215    *
216    * @return the flag to determine if only the current release version is to be
217    *         rendered (<code>true</code>) or all versions are to be considered (
218    *         <code>false</code>).
219    */
220   public boolean isCurrentReleaseVersionOnly()
221   {
222     return currentReleaseVersionOnly;
223   }
224 
225   // --- business -------------------------------------------------------------
226 
227   // --- object basics --------------------------------------------------------
228 
229 }