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