View Javadoc

1   /*
2    * Copyright 2008-2010 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  
17  package de.smartics.maven.issues.bugzilla;
18  
19  import java.util.Locale;
20  
21  /**
22   * The report to generate release notes.
23   *
24   * @goal bugzilla-section-report
25   * @phase site
26   * @requiresProject
27   * @description Generates a report using issues from the issues management
28   *              system ordered by the target version.
29   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
30   * @version $Revision:$
31   */
32  public class BugzillaSectionReportMojo extends AbstractBugzillaReportMojo
33  {
34    // ********************************* Fields *********************************
35  
36    // --- constants ------------------------------------------------------------
37  
38    // --- members --------------------------------------------------------------
39  
40    /**
41     * Specifies the name of the file to write the issues report (without
42     * extension).
43     *
44     * @parameter expression="${issues.release.report.fileName}"
45     *            default-value="issues-section-report"
46     * @required
47     * @since 1.0
48     */
49    private String outputName;
50  
51    /**
52     * The name of the class that runs the rendering of the report page.
53     *
54     * @parameter default-value=
55     *            "de.smartics.maven.issues.bugzilla.VersionedSectionReportRenderer"
56     * @required
57     * @since 1.0
58     */
59    private String reportRenderer;
60  
61    /**
62     * Lists the columns to be rendered. Each element of this list is a property
63     * of an issue. The identifiers given here must match the ones defined in the
64     * referenced issue management system. E.g. for Bugzilla these are defined in
65     * <code>org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute</code>.
66     * <p>
67     * The values are separated by comma.
68     * </p>
69     *
70     * @parameter default-value=
71     *            "bug_id,short_desc,resolution,bug_severity"
72     * @required
73     * @since 1.0
74     */
75    private String columns;
76  
77    /**
78     * Lists the column width to be used to set to the columns. If the value is
79     * <code>0</code> (zero) no width will be set explicitly for that column.
80     *
81     * @parameter default-value= "65,0,100,100"
82     * @required
83     * @since 1.0
84     */
85    private String columnWidths;
86  
87    // ****************************** Initializer *******************************
88  
89    // ****************************** Constructors ******************************
90  
91    // ****************************** Inner Classes *****************************
92  
93    // ********************************* Methods ********************************
94  
95    // --- init -----------------------------------------------------------------
96  
97    // --- get&set --------------------------------------------------------------
98  
99    /**
100    * {@inheritDoc}
101    *
102    * @see org.apache.maven.reporting.MavenReport#getOutputName()
103    */
104   public String getOutputName()
105   {
106     return outputName;
107   }
108 
109   /**
110    * {@inheritDoc}
111    *
112    * @see org.apache.maven.reporting.AbstractMavenReport#getName(java.util.Locale)
113    */
114   public String getName(final Locale locale)
115   {
116     return getTitle() != null ? getTitle() : getBundle(locale).getString(
117         "report.name.release");
118   }
119 
120   /**
121    * {@inheritDoc}
122    *
123    * @see org.apache.maven.reporting.AbstractMavenReport#getDescription(java.util.Locale)
124    */
125   public String getDescription(final Locale locale)
126   {
127     return getDescription() != null ? getDescription() : getBundle(locale)
128         .getString("report.description.release");
129   }
130 
131   // ... report related .......................................................
132 
133   /**
134    * Returns the name of the class that runs the rendering of the report page.
135    *
136    * @return the name of the class that runs the rendering of the report page.
137    */
138   protected String getReportRenderer()
139   {
140     return reportRenderer;
141   }
142 
143   /**
144    * Returns the value for columns.
145    * <p>
146    * Lists the columns to be rendered. Each element of this list is a property
147    * of an issue. The identifiers given here must match the ones defined in the
148    * referenced issue management system. E.g. for Bugzilla these are defined in
149    * {@link org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute}.
150    * <p>
151    * The values are separated by comma.
152    * </p>
153    *
154    * @return the value for columns.
155    */
156   protected String getColumns()
157   {
158     return columns;
159   }
160 
161   /**
162    * Returns the value for columnWidths.
163    * <p>
164    * Lists the column width to be used to set to the columns. If the value is
165    * <code>0</code> (zero) no width will be set explicitly for that column.
166    * </p>
167    *
168    * @return the value for columnWidths.
169    */
170   protected String getColumnWidths()
171   {
172     return columnWidths;
173   }
174 
175   // --- business -------------------------------------------------------------
176 
177   // --- object basics --------------------------------------------------------
178 
179 }