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